|
Paul King wrote: > I too have only used matching indicators one, many years ago, but my > recollection of these is that the program would continue reading from each > file until the key in BOTH changed, thus, detail records which had no header > records in the related file, for example, would still be returned to the > program, as would header records with no detail, the presece of either, or > both, being indicated by the assigned file indicator being on or off.. Actually, the clearest way of thinking about matching record indicators and their function is that they provide a way to key-merge records from different files and possibly different formats into a single steam of records. The MR indicator comes on when you are processing files from either the primary or any of the secondary files that match the key values in the other files at that moment. > This provides functionality which (to the best of my knowledge) still isn't > available in SQL, i.e. an outer join (if thats the right way of phrasing it > - I'm not an SQL guru), rather than the normal two statements, one left join > and one right join, then some horrible code to stick the extracted data > together. Yup, NOT an outer join. As I pointed out earlier, a merge. The only other convenient way that I know of doing this is to build a mult-format logical over multiple physical files. > The downside I seem to recall is that it only works with the RPG > cycle. Is my recollection correct - or not?! > Yup, MR only comes on with the use of primary and secondary files in the RPG cycle. The M1 thru M9 indicators are used like L1 thru L9 indicators, but instead match the "key" fields between primary and secondary files. The RPG cycle must do the reads and the records are returned to the program one by one. -- =========================================================== R. Bruce Hoffman, Jr. -- IBM Certified AS/400 Administrator -- The sum of all human knowledge is a fixed constant. It's the population that keeps growing! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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.