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


  • Subject: Re: CHAIN versus SETLL
  • From: Neil Palmer <npalmer@xxxxxxxxxxx>
  • Date: Thu, 22 May 1997 20:33:11 -0400
  • Organization: NxTrend Technology - Canada

Rick Baird wrote:
> 
> boothm@earth.goddard.edu wrote:
> 
> > Don't you need to do a setll,
> >  then do a read,
> >  then do a compare to your key,
> >  to see if the record you seek is actually there?
> >
> > Whereas, with a chain you need only hit the file's index to set on the
> >
> > no-hit indicator?
> >
> I think the intent of the questioner was to position the file for future
> read(s) (chain with no-hit vs. setll).
> 
> IMO, in todays world of big iron, the answer is simple - code it the way
> that will make it the most readable.
> 
> C    KEY    CHAINFILE            90
>  *
> C    *IN90  IFEQ *ON
> .......etc.
> 
> this makes it pretty obvious that the programmer has a complete key, and
> wants to know if "a particular" record exists or not.
> 
> C    PRTKEY  SETLLFILE
> C    PRTKEY  READEFILE                90
>  *
> C    *IN90   DOWEQ*OFF
> C............etc.
> 
> This makes it obvious that the intent is to read a set of records, not
> just one.
> 
> The days of saving a few nano seconds per cycle at the expense of
> readability are long over. The instructor should have answered that it
> doesn't make any difference which opcode he uses and that the program
> should be designed in such a way that you minimize ALL reads/sets/chains
> and that if it takes an analyst an extra hour to decifer bad code, this
> is much more expensive than the difference between setll/chain
> 

Exactly !!   The few minutes you spend trying to tweak the program, and
the extra time it takes someone to make future mods, must be offset by
the few nanoseconds you save trying to squeeze every last ounce of
performance out of the code.  If it was a batch program that was going
to be running 24 hours a day for the next 1,000 years you might JUST
save enough CPU cycles to make it worthwhile, otherwise forget any
attempts to tweak the code and write for clarity.

(Although - when I think about it you could apply this argument to say
you should use data data types in all your files for clarity - however
with the poor performing way IBM have implemented them I would say that
this could be one exception to the rule).

-- 
... Neil Palmer                                      AS/400~~~~~      
... NxTrend Technology - Canada      ____________          ___  ~     
... Markham,  Ontario,   Canada      |OOOOOOOOOO| ________  o|__||=   
... Phone: (905) 731-9000  x238      |__________|_|______|_|______)   
... web:http://www.nxtrend.com        oo      oo   oo  oo   OOOo=o\   
... mailto:npalmer@nxtrend.com     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-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 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.