Browse example
Here is an example of a typical browse sequence. This code retrieves the names of all the files installed in the system and calls a subroutine to process information about the recovery characteristics if the file is open.
EXEC CICS INQUIRE FILE START END-EXEC.
PERFORM UNTIL RESPCODE = DFHRESP(END)
EXEC CICS INQUIRE FILE(FILENAME) NEXT
OPENSTATUS(OPENSTAT)
RECOVSTAT(RCVRSTAT)
FWDRECSTATUS(FWDSTAT)
RESP(RESPCODE) END-EXEC
IF RESPCODE = DFHRESP(NORMAL)
IF OPENSTAT = DFHVALUE(OPEN)
CALL RCVY-RTN USING RCVRSTAT FWDSTAT
END-IF
ELSE CALL ERROR-RTN END-IF
END-PERFORM.
EXEC CICS INQUIRE FILE END END-EXEC.