Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.28.6.2 Indexed or Relative Files



The NEXT RECORD is the next logical record in the key sequence.


X >_Workstation_> Under AIX, OS/2, and Windows, PREVIOUS RECORD is the prior
X logical record in the key sequence. <_Workstation_<

For indexed files, the key sequence is the sequence of ascending values of the current key of reference. For relative files, the key sequence is the sequence of ascending values of relative record numbers for records that exist in the file.

Before the READ statement is executed, the file position indicator must be set by a successful OPEN, START, or READ statement. When the READ statement is executed, the record indicated by the file position indicator is made available, if it is still accessible through the path indicated by the file position indicator.

If the record is no longer accessible (because it has been deleted, for
X example), the file position indicator is updated to point to the next (or
X previous) existing record in the file, and that record is made available.

For files in sequential access mode, the NEXT phrase need not be specified.


X For files in dynamic access mode, the NEXT phrase (or alternatively for
X AIX, OS/2, and Windows, the PREVIOUS phrase) must be specified for sequential record retrieval.

AT END Condition: If the file position indicator indicates that no next

X logical record exists, (or alternatively for AIX, OS/2, and Windows, no
X previous record exists), or that an optional input file is not present.

>_Host_> Under OS/390 and VM, the same procedure occurs as for sequential files (see "At End Condition" in topic 6.2.28.6.1). <_Host_<


X >_Workstation_> Under AIX, OS/2, and Windows see the discussion on
X PREVIOUS RECORD on 6.2.28. <_Workstation_<

If neither an at end nor an invalid key condition occurs during the execution of a READ statement, the AT END or the INVALID KEY phrase is ignored, if specified. The same actions occur as when the at end condition does not occur with sequential files (see "At End Condition" in topic 6.2.28.6.1).

Sequentially Accessed Indexed Files: When an ALTERNATE RECORD KEY with
DUPLICATES is the key of reference, file records with duplicate key values are made available in the order in which they were placed in the file.

Sequentially Accessed Relative Files: If the RELATIVE KEY clause is
specified for this file, READ statement execution updates the RELATIVE KEY data item to indicate the relative record number of the record being made available.

Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.