× 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: Secondary file with zero records causes LR in ILE
  • From: Melody Haley <MHaley@xxxxxxxxxxxxxx>
  • Date: Tue, 16 May 2000 16:48:24 -0500

 We currently have some legacy code that we are converting to ILE.  We used
CVTRPGSRC and recompiled a program that has a primary file and a secondary
file, with the eof indicator on the secondary file.  If the secondary file
has zero records, when the program runs it goes straight to LR without
processing the records in the primary file.  IBM Support Line answered the
problem with the following:     

The manual states "For multiple input files, the end-of-program (LR)
condition occurs when all input files for which an E is specified in
position 19 (position 17 for OPM) has been processed." A file is considered
processed when the last sequential input operation to the file resulted in
an EOF condition. When an RPG program contains primary and secondary files,
a record is read from each file and placed in the input buffer (not input
fields) for each file. In an OPM program, if any of the files did not
contain a record, the EOF condition would be saved and when the file was
selected for input (move the input data from the input buffer to the input
fields) the end-of-program condition (LR) would be set on. For normal
multi-file processing, the primary file is processed first and secondary
files are processed next in the order of their F-Spec definition. In an ILE
program, if any of the files did not contain a record, the EOF condition
would set the end-of-program condition. This results in the program going
to end-of-program with processing any detail calcs. This is a difference
between OPM and ILE which will be documented in the next release of the
Programmers Guide.

Since this change involves changing the logic in about 50 programs for us,
we consider it more than an undocumented change, it seems like a bug...what
about it Hans?   
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.