TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

CICS VSAM Browse Operation & Command


VSAM Browse Operation:

The browse operation is used for fetching the records sequentially from the underlying VSAM file based on selection criteria.

Sequential access of VSAM file under CICS is called Browsing. It has FIVE Commands associated with it.

Read/Browse Operation in VSAM:

VSAM Read Browse Operation

The browse operation consists of three steps:

  1. Establish the position from where to begin the sequential retrieval.

  2. Retrieve records sequentially and process them as required.

  3. Terminate the browse when no further sequential retrieval is required.

The starting position for browse may be re-established at any time during the browse operation.

A record that has been retrieved as part of a browse cannot be updated during browse. For that, browse operation should be terminated and the record should be read again with update option.


VSAM BROWSE Command:

  • STARTBR - Establish starting position within file.

  • READNEXT - Retrieve records in ascending order sequentially as set by STARTBR.

  • READPREV - Retrieve records in descending(reverse) order as set by STARTBR.

  • RESETBR - Reset browse by re-positioning the pointer.

  • ENDBR - Terminate browse


UPDATE during BROWSE:

Update and Browse are mutually exclusive functions. So if you want to update a record during the browse operation, first issue ENDBR. Then give random read using the key in hand with UPDATE option. REWRITE the record. Then issue STARTBR with the key in hand and continue the browsing.



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal