×
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.
On 8/31/2011 9:28 AM, Jon Paris wrote:
Just one more reason why I always tell folks to never ever code %EOF
without a file name. I've seen so many cases where this kind of thing
happens - not because of a subfile normally, but just because during
maintenance a programmer added another file (or changed usage of an
existing file) and all of a sudden there's more than one thing that
can trigger the generic %EOF().
Yes, I know I should qualify %EOF. You and Raul both point that out.
The problem is that the %EOF is after a case statement like this:
select;
when order = 1;
reade (key) file1;
when order = 2;
reade (key) file2;
other;
reade (key) file3;
endsl;
Originally there was one file, and just changing %eof(file1) to %eof()
worked ... sort of. The right answer if I really wanted to use EOF as
the trigger would be to have an EOF variable and set that variable in
each of the cases:
select;
when order = 1;
reade (key) file1;
eof = %eof(file1);
when order = 2;
reade (key) file2;
eof = %eof(file2);
other;
reade (key) file3;
eof = %eof(file3);
endsl;
And that's why I didn't want to go too terribly deeply into the
details... I know I done bad. I just wanted to point out that the folly
of my laziness still had a silver lining: I learned about %eof and the
subfile!
Joe
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.