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.
The browse operation consists of three steps:
Establish the position from where to begin the sequential retrieval.
Retrieve records sequentially and process them as required.
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.
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 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!