× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Logical File with Field being substringed as a Key
  • From: MacWheel99@xxxxxxx
  • Date: Mon, 27 Mar 2000 11:55:15 EST

Getting character data to numeric is a royal pain in the Query/400 neck ... 
allegedly it can be done through the time stamp function ... I have seen a 
lot of examples with people spelling out step by step how to do that, but 
when I have tried to do it I cannot get it to work & this weekend on the 
trade zine sub-forums of Query/400 discussion I learn that padded blanks are 
my problem - I do not remember which one it was - I was in several ... you 
might check out these two, both of which have a bunch of threads on Query 
challenges:
http://www.as400network.com/communities/
http://www.midrangecomputing.com/forums/

But I am also still having a hassle with Query/400 date math, even though 
BPCS_L spelled out the answers in novice step by step detail.

Getting character data to numeric is real easy in RPG ... if you know certain 
substring characters always supposed to be numeric & extract, then overlay 
via data structure with numerically defined field, but hit one piece of bad 
data & you got a decimal data error ... now there is some way to test data 
for non-numeric content before you do this, and bypass the bad data.

>  From:    dpanco43@ix.netcom.com (Debbie Panco)

>  It is my understanding that the digits function converts numeric data to
>  character.  What I want is the opposite.  I want to take a 25 character
>  alpha field and extract positions 8 & 9 that I know will always contain
>  numeric data.  then I want to call those 2 positions a numeric field so 
that
>  I can do calcs with it.  I don't see how your digits function will help me
>  here.

With the time stamp function, if you have 6 characters that you know are 
numeric, which could include some numbers you just plugged in via 
concatenation to get this to work, and of course you will plug in leading 
zeros for your string so that the end result calcs will be meaningful.

The URL given in the BPCS_L discussion on this was
http://as400service.rochester.ibm.com/
folder
Tech Info & Databases
Software Knowlege Base
search for document # 4892030
then for what it says about TIMESTAMP accepting character string as valid 
time stamp including 6 digit microsecond so 6 digit some other number really 
be there

Al Macintyre  ©¿©
http://www.cen-elec.com MIS Manager Programmer & Computer Janitor
The road to success is always under construction.
When in doubt, read the manual, assuming you can find the right one.
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.