CICS BROWSING Chapter 14 STARTBR Gets ready for
CICS BROWSING Chapter 14
STARTBR • Gets ready for BROWSE operation • EXEC CICS • STARTBR DATASET(“filename”) RIDFLD(record key) GTEQ | EQUAL RESP(RESPONSE-CODE) • END-EXEC
STARTBR Notes • Set RIDFLD to LOW-VALUES to start at beginning of file. • Set RIDFLD to HIGH-VALUES to start at end of file (Must use READPREV first!) • Sets pointer to appropriate record in the file. • Does NOT read any data! • NOTFND condition occurs if no match
READNEXT • Reads ‘next’ record - forward • EXEC CICS READNEXT DATASET(“filename”) INTO(recordname) RIDFLD(keyfield) RESP(RESPONSE-CODE) • END-EXEC
READNEXT Notes • Retrieves the NEXT record in the file in the forward direction. • The ENDFILE condition is raised if at end of file. • A READNEXT command that follows a READPREV command will retrieve the same record. • Changing the RIDFLD will get the record specified.
READPREV • Reads ‘next’ record – backward • EXEC CICS READPREV DATASET(“filename”) INTO(recordname) RIDFLD(keyfield) RESP(RESPONSE-CODE) • END-EXEC
READPREV Notes • Retrieves the NEXT record in the file in the backward direction. • The ENDFILE condition is raised if at the beginning of the file. • A READPREV command that follows a READNEXT command will retrieve the SAME record! • Changing the RIDFLD will get the record specified.
ENDBR • Terminates BROWSE operation • EXEC CICS ENDBR DATASET(“filename”) • END-EXEC
RESETBR • A combined STOPBR and STARTBR • EXEC CICS • RESETBR DATASET(“filename”) RIDFLD(record key) GTEQ | EQUAL RESP(RESPONSE-CODE) • END-EXEC
- Slides: 9