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




I think I understand.  When you say it reads all recs from primary, and then 
from secondary, I assume you mean that all files are read from on each loop 
through.  A free format equivalent (minus record blocking) would look like this:

Dow Not %EOF(primary)
Read primary;
Read secondary;
// Calc specs
EndDo;


Well, not exactly, but sort of, and it sounds like you got the general idea<g>. You have a sequence in your input files that matches fields from each and you want to group them together. Like in your program, after naming your comparison fields in the I-specs, you'd just test for *INMR = *OFF *AND test for the secondary file input record, and then you'd have your non-matching record (in the primary file).

You're probably just as well off without nowadays, because it could get kind of complicated to explain somewhere like here. If it's not intuitive, and you've been counselled where you are to avoid it, it's probably just as well. It's something that's very unique to RPG, and sometimes it saved some complicated coding, and makes simple report programs with totals and subtotals pretty easy. Most of that kind of reports can be done easily enough with query or SQL now, except for fancy formatting and for maybe updates.

In my RPG classes I've had veteran COBOL programmers that got stuck for days trying to figure out where there was a "READ" statement in the code, even in the exercises they did themselves that worked!

- Alan

Right? This might be interesting to try, although having seven pairs of files to compare/synchronize, I would have to write seven programs.


Seven?  You're probably better off avoiding the cycle anyway in this case.

But if it is faster, I might try it.

One last question. There is a possibility that a record might be
missing from either file, causing the synchronization of the input
streams to be out of whack. If this is the case, Can I issue a READ op in the calc specs to either file to re-synch the files?


With primary and secondary and the proper specifications on the input specs, the cycle would take care of that for you. If you only want to process the records that match, you'd use the matching records indicator.

I suspect the compiler team might even be thinking yank out the cycle for RPG-V! Along with the remaining fixed-format specs! Most programs today are on-line real-time processing, in ancient computer times it was more batch data entry and then batch processing.

- Alan







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.