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



Doug wrote:
It is available *only* if you use a program-described file. For some
unknown (to me) reason, you can't use them with externally defined files.


Doug -

Another caveat:
You /cannot/ use lookahead with files opened for update:

http://publib.boulder.ibm.com/infocenter/iadthelp/v7r1/topic/com.ibm.etools.iseries.langref.doc/evferlsh103.htm

"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 next record. "


I distinctly remember this limitation from a program I wrote in 1984 as the
CPP for a command called RMVELSE.

A previous programmer had added an ELSE statement for every If statement in
every program. When reading his code, at the end of a block of logic you
would see:

ELSE
END
ELSE
END
ELSE
END
ELSE
END
ELSE
END

...So I wrote created my command to use it on each of his programs /before/
I ever made any changes.

I started out using lookahead fields, but after I realized that you can't
use them on an update file I created a logical file and made my logic such
that every time I read an ELSE I would set a flag and save the source
sequence number, then if the very next statement was an END I would CHAIN
back to the source member using a logical file built over the SRCSEQ field
with the sequence number of the ELSE statement and delete it.

- sjl




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.