Module 10: CICS Transaction Processing
RETURN TRANSID
EXEC CICS RETURN with the TRANSID option ends the current task and tells CICS which transaction to start when the terminal user responds.
It is the heart of pseudo-conversational programming: the task ends, the user sees no break, and the conversation continues.
What RETURN TRANSID does
- Ends the current execution of the program and frees the task and its resources.
- CICS keeps the terminal session and starts the named transaction on the next user input.
- The COMMAREA option carries a data area forward to the next execution.
- The IMMEDIATE option starts the next transaction at once, without waiting for terminal input.
RETURN versus RETURN TRANSID
- A plain RETURN ends the task and returns control to CICS or to the program that called this one.
- RETURN TRANSID schedules the next transaction for the same terminal, continuing the conversation.
- Use a plain RETURN when the conversation is finished; use RETURN TRANSID to continue it.
- RETURN TRANSID is normally the last statement the program executes.
Passing data with the COMMAREA
- COMMAREA names a WORKING-STORAGE area and LENGTH gives its size.
- CICS stores it in a temporary communication area between the two executions.
- The next execution receives it in the DFHCOMMAREA field of the LINKAGE SECTION.
- Keep it short: carry control flags, keys, and counters - not whole file records.
Example of RETURN TRANSID
- This ends the current execution and schedules transaction ORD1 next, passing 50 bytes of working storage.
- EXEC CICS RETURN TRANSID('ORD1') COMMAREA(WS-COMM-AREA) LENGTH(50) END-EXEC.
- When the user presses a key, CICS starts ORD1 and the program finds the 50 bytes in DFHCOMMAREA.
