Sequential reading (browsing)
Use the STARTBR , READNEXT , READPREV , and RESETBR commands to browse records in a file. You can browse forwards or backwards, and change the position or characteristics of the browse while the browse is in progress. Use the ENDBR , SYNCPOINT and SYNCPOINT ROLLBACK commands to end the browse.
About this task
When browsing records, you generally identify and read the records in the same way as for a direct read using the READ command (see Direct reading (using READ command) ). You specify the record identification field ( RIDFLD option), and select a destination for the read records. If the file is open in RLS mode, you can use the UNCOMMITTED , CONSISTENT , REPEATABLE and NOSUSPEND options to control read integrity. Some additional special cases for browsing are noted in this topic.
- For a KSDS, a full key, a generic key, or an alternate key can be used.
- For a standard (non-extended) ESDS, an RBA or an alternate key can be used.
- For an extended ESDS, an extended RBA (XRBA) can be used.
Note: In some circumstances, a 32-bit RBA can be used to access an extended (64-bit) ESDS: see Relative record number (RRN), relative byte address (RBA) and extended relative byte address (XRBA).
- For an RRDS, an RRN is used.
If you use an alternate key for browsing, the records are retrieved in alternate key order. If the alternate key is not unique, the DUPKEY condition is raised for each retrieval operation except the last occurrence of the duplicate key. For example, if there are three records with the same alternate key, DUPKEY is raised on the first two, but not the third. The order in which records with duplicate alternate keys are returned is the order in which they were written to the data set. This is true whether you are using a READNEXT or a READPREV command. For this reason, you cannot retrieve records with the same alternate key in reverse order.
CICS allows a transaction to perform more than one browse on the same file at the same time. You distinguish between browse operations by including the REQID option on each browse command.
The instructions in this topic cover general principles for browsing, and specific information for the different types of VSAM data set. For specific information about browsing BDAM data sets, see Browsing records from BDAM data sets.