Question

  Asked: Dec 13 2007   4:51 PM GMT
  Asked by: DJA


SETLL vs. LOOKUP


iSeries applications, LOOKUP, *INZSR, SETLL

Fact based opinions requested. Is it faster to perform a SETLL on a file to do an existence test or read the file (note: it has a very small number of records) into a program array during *INZSR and then do a LOOKUP to do the existence test?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



Better way is to use LOOKUP for execution of test on Program array and if it is physical/ logical file then you can use Chain.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Andy Mansell  |   Dec 14 2007  2:29PM GMT

This very much depends on the requirements.

Will you need to access the data for every record on the file?
Will the file ever get bigger than the small number of records.

With the speed of todays processors the overhead will be very low any way.

A general rule of thumb tho is ‘ if you need to use the data , retrieve the data from the file. It may be quicker to access to an array and read the data from that array. Depending on the number of reads you will be doing from the file…. Is it possible you will read the same record numerous times etc.

If you never need to read the data use SETLL to verify the record exists, the save will be small but it will be easier for other programmers to see what and why you are doing what you are doing