× 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 vs. SETLL (was Re: DOW vs DOU)
  • From: "Steven Easton Mail" <seaston@xxxxxxxxx>
  • Date: Thu, 5 Jun 1997 07:57:50 -0500

Even on the early models of the AS400, the chain with a PARTIAL key did not
work exactly the same as the SETLL.  The chain would use any record that
matched the search criteria depending on what was in the unspecified fields
& RRN.  This same bug was found in early releases of the SETLL function on
the S/38.  You could get around it by specifying all key field on either
command if the file was unique keyed.  Unspecified key fields were not set
to low values before the chain.  Yes, some times I still code around old
bugs like this, and I occasionally  set off indicators before I do a read
equal.  Remember that the record number is the last key of every indexed
file.  Some files do not have a unique index.  Therefore the SETLL (early
38) and chain (38 & early 400) had problems with reading all records in
these files.  If you can't trust a function to work all the time, don't use
it all.  When you have been burned bad enough, you stay away from the fire.

Steven Easton
seaston@ionet.net
http://www.ionet.net/virtual/dpma/
http://www.centuryma.com/

> >Kahn, David wrote:
> >> So was Greg Thielen wrong when he wrote the following?
> >>
> >> >>There was also a time (pre-AS/400 and even S/38 I think)
> >> >>when CHAIN didn't set the file pointer as it does now.  You _had_ to
> >> >>use SETLL/READ.
> >>
> >> RPG historians?
> >>
> >
> >SETLL always sets the file pointer even in S/34 ! The problem was when
> >the pointer would be beyond the end of file, in which case SETLL will
> >fail and the pointer will remain where it was before the SETLL.  Now we
> >have the hi indicator available to signify this condition.
> 
> The question was whether CHAIN has always set the file cursor.
> 
> As far as SETLL is concerned, however, there is a subtle difference
between 
> the way it works on S/34 and S/36 and the way it works on the AS/400,
even 
> in S/36 Compatible RPG/II. On the old machines SETLL does not set the
file 
> cursor immediately but causes the next read to do so. On the AS/400 it
sets 
> the file cursor immediately. In most cases there is no practical
difference 
> between the two. However, the end of file condition Dave mentioned is
one, 
> and executing an output operation between the SETLL and the CHAIN is 
> another. See the System/36-Compatible RPG II User's Guide and Reference
for 
> further details. In my edition, SC09-1818-00, it is in Appendix A.9.
> 
> Dave Kahn - Tengizchevroil, Kazakstan
> =========

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

Follow-Ups:

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.