|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
I have a beautiful file that dates back to either punch cards or a
programmer who learned on punch cards. One of the wonderful things he did
was create a 4 0 field that means different things in different situations.
The last digit of the field can be 0 thru 4 and that is the information I
need to break on in a report I'm writing. Unfortunately that means that I
have to read through all of the records and then compare the last digit for
a match otherwise I loop back and read again.... Needless to say this
creates a phenominal amount of extra I/O AND it screws me up when I'm trying
to hold onto other data from valid passes.
So I got out my handy dandy DDS manual and looked into the SST keyword for
logical files. Seems straightforward enough so I give it a try.
I created this:
A R F_DETLHIST PFILE(DETLHIST)
<snip>
A DHOLOC 4S 0
A SPPRICE 1A I SST(DHOLOC 4 1)
A K DHSDAY
A K DHHOT#
A K DHSHOW
A K DHSRC
A K SPPRICE
A O DHSTAT VALUES('D')
and now my logical file has a field tacked on the end which SQL lists as 1
char and only lets me search for valid char data. Everything looks good and
the values of SPPRICE are the last digit of DHOLOC.
But when I add this logical file to my program and try to compile it it says
that the KFLD at sequence number xxx is CHAR but key field is NUMERIC.
If I change my key field to numeric in my program then it won't compile
because it says that the KFLD at sequence number 946 is 1 long, Key field is
4 long.
4 long is the size of the field that I did the SST on to create the SPPRICE
key....
If I change my key field to 4 long then it will compile but it doesn't
include the substring function... it still returns the full 4 digit number
as if it were just using DHOLOC and not using my substring of the DHOLOC.
What gives????
Jim Sneddon
AS/400 Development Manager
Allstate Ticketing
1421 Sunset Road Suite 4
Las Vegas, NV 89119
702-617-5540
www.showtickets.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.