|
I was just about to day no when I saw that you are using indicators. If you where using the %eof bif it doesn't I have had problems with that in the past. -----Original Message----- From: Mark Adkins [mailto:adkinsm@amerch.com] Sent: Thursday, May 09, 2002 9:48 AM To: rpg400-l@midrange.com Subject: Using CHAIN instead of SETLL AND READE to begin a loop which reads a group of records. I can't find any documentation that addresses this. If there is a table of order detail which has an index on Order #, and UPC. Will these two pieces of code execute identically. 1. MYORD# CHAIN ORDDTL 99 *IN99 DOWEQ*OFF <SOMECODE> MYORD# READE ORDDTL 99 ENDDO 2. MYORD# SETLL ORDDTL MYORD# READE ORDDTL 99 *IN99 DOWEQ*OFF <SOMECODE> MYORD# READE ORDDTL 99 ENDDO What if the index is not unique? What if I set my pointer past the end of file before execution? Human logic dictates that a CHAIN should return the first occurrence of the index which would be the smallest upc. Computer implementation dictates that the CHAIN should return the first occurrence of MYORD# found via an algorithm. So, does the algorithm match human logic? Ever wonder why the 1st array element in most programming languages is 0? Or is it just me... Regards, Mark _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.