× 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 re-read Chandra's original post, and I did not see anywhere that the process in question was for the purposes of looping through a set of records. It may have been; I just didn't interpret it that way. My interpretation was "How to determine if a specific record is in the table." Such as a customer number in the customer master; not finding the records for a specific customer in, say, a history file.

Personally, I'm a big fan of standards, though my own (it's a one-man shop!) change over time. Either because (a) what was true yesterday is not true today (usually meaning, "I was wrong"), or (b) I found a better way (or a method that I like better). A good example of (b) would be subprocedures -vs- subroutines. I was a Johnny-come-lately to subprocedures but, while I still use subroutines (usually for control mechanisms), more and more I use subprocedures so my standards changed.

If the reason for the diktat is for performance issues, Chandra (or the Sr. Programmer) would need to devise a test that could measure the case(s) for which their rule applies. For example, in a batch program against a ton of records (how many bytes in a ton?) it may be that SETLL/READE is more efficient than CHAIN and, if so, might significantly reduce the job's run-time. But for an interactive program where one is going for a specific record (customer master example), what's a couple of nanoseconds among friends?

My personal preference for record access is to use CHAIN when going for a discrete record, and SETLL/READ when going for (potentially) a group of like records (as illustrated by Jeff and others). For me replacing CHAIN processing (discrete record access) with the SETLL/READE method would be confusing, but only because that is the way that I was raised. The opposite might apply in Chandra's shop.

Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of jdavis@xxxxxxxx
Sent: Tuesday, September 02, 2008 9:37 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Chain vs SetLL/ReadE

My quess for the following code

SetLL (KeyFields) FIleName;
ReadE (KeyFields FIleName;
DoW Not %EOF(FIleName);
do my stuff
ReadE (KeyFields) FileName;
EndDo;

Would be for the following, the chian function will not return a %EOF
condition, it returns a %Found. So using a chain will add an extra check
in your loop.

Chain (KeyFields) FIleName;
If %Found(FileName)
DoU Not %EOF(FIleName);
do my stuff
ReadE (KeyFields) FileName;
EndDo;
EndIf;

Thanks,
Jeff Davis
Dental Network of America


**********

The information contained in this communication is confidential, private, proprietary, or otherwise privileged and is intended only for the use of the addressee. Unauthorized use, disclosure, distribution or copying is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately at (312)653-6000 in Illinois; (800)835-8699 in New Mexico; (918)560-3500 in Oklahoma; or (972)766-6900 in Texas.

**********
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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 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.