|
Hi Richard, Thanks so much for your response! I have the Cobol softcopy and I see the references to some of the items I'm asking about, but I'm trying to get an understanding of how the RPG & Cobol techniques compare, and that's not real clear in the manual. For example, as I explain below, it appears that Cobol has no equivalent of RPG's READE. When a READ is done, without NEXT, does it automatically use the key defined in the RECORD KEY phrase of the file's SELECT group? I noticed the KEY IS phrase in the syntax diagram, but the example I provided does not use it. Is KEY IS sort of an override to use a different key than the one specified in the SELECT? In the START example: When is it an INVALID KEY? If there are no records with a key that are "not less than" (sheesh, this should be "greater than or equal to", yes?) the key defined? Are the following statements correct: 1) READ without NEXT uses the key to do an RPG-type CHAIN; if a record having the specified key does not exist, no record is returned to the program. 2) READ NEXT always reads the record following the current record, regardless of the key. I interpret that to mean that a READ NEXT is strictly an RPG-type READ (and not READE). The lack of the INVALID KEY phrase in the example seems to confirm this. Thanks again! - Dan --- Richard Casey <casey_r@popmail.firn.edu> wrote: > Hi Dan, > > You should be able to track down a COBOL reference manual at the > InfoCenter. > Check out > http://publib.boulder.ibm.com/cgi-bin/bookmgr/DOCNUM/SC09-1813-00 > > I know enough RPG to be dangerous (?!) so bear with me. > > The PCPESTCCP-READ paragraph is a random read (similar to RPG's > CHAIN). I'm > assuming that the file is defined as ACCESS DYNAMIC in the > FILE-CONTROL > section. ACCESS DYNAMIC allows you to do both sequential and random > processing against a file. > > The PCPESTCCP-READ-NEXT paragraph is a sequential read (similar to > RPG's > READE). If I read the RPG manual correctly, READE allows you to > specify a > search argument that controls if READE returns a record to you or > not. > COBOL's READ NEXT is a little different in that it will return the > next > record regardless of the key (unless you hit end of file). You would > then > need to check the record to see if met your criteria. > > The PCPESTCCP-START-NOTLESS paragraph positions the file at the first > record > where the key is not less (i.e. >=) the specified value. This matches > up > with RPG's SETLL. > > Hope this helps! Holler if you need more info. > > Richard Casey __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
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.