× 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.



Um, say what?  You mean I've been coding look aheads in my RPG programs all 
these years, and they exist natively?

Arg!  How did I miss that in the RPG manual?

Regards,

Jim Langston

-----Original Message-----
From: Richard B Baird [mailto:rbaird@esourceconsulting.com]

your problem with lookahead fields is that the file must be internally
described.

to get away from that problem, here is an example of how to externally
describe them - sort of.

just make sure your record length is greater than or equal to the actual
files record length.

also, lookahead only works for Input files, not Update.

hth,

Rick

Fextfile   IP   F  200        disk

Dfileext1       e ds                  extname(extfile)  prefix(p)Dfileext2
e ds                  extname(extfile)  prefix(l)

Iextfile   ns  01
I                                  1  200  data

I          aa  **
I                                  1  200  lookahead

C                   if        *in01
C                   eval      fileext1 = data
C                   eval      fileext2 = lookahead
C                   end

 * you now have the data from fields in
 * both the current record (prefixed with 'p')
 * and the fields from the next record
 * (prefixed with 'l') in your programs

 * When a record is being processed from a combined
 * file or an update file, the data in the
 * lookahead field is the same as the data in the
 * record being processed, not the data in the
 * not the data in the next record.


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.