CICS RETRIEVE retrieves data that was previously passed to the current task. It enables programs to get passed data, manage task communication, and handle data retrieval in CICS applications.
CICS RETRIEVE is a command that allows programs to retrieve data that was previously passed to the current task. It provides data retrieval capabilities, task communication, and data access for CICS applications.
12345EXEC CICS RETRIEVE [INTO(data-area)] [LENGTH(data-length)] [RESP(response-code)] END-EXEC
123456789101112131415161718192021222324WORKING-STORAGE SECTION. 01 RETRIEVED-DATA PIC X(100). 01 DATA-LENGTH PIC S9(8) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. *> Retrieve data passed to this task EXEC CICS RETRIEVE INTO(RETRIEVED-DATA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC. IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Data retrieved successfully' DISPLAY 'Data length: ' DATA-LENGTH DISPLAY 'Retrieved data: ' RETRIEVED-DATA(1:DATA-LENGTH) ELSE IF RESPONSE-CODE = DFHRESP(NODATA) DISPLAY 'No data available to retrieve' ELSE DISPLAY 'Error retrieving data: ' RESPONSE-CODE END-IF END-IF.
Think of CICS RETRIEVE like checking your mailbox:
Create a program that retrieves data and displays it.
Write a program that handles the NODATA condition.
Implement data validation for retrieved data.