Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 8: CICS Program and Data Passing


RETURN

What the RETURN command does

  • RETURN ends the current program's execution and gives control back to CICS or to a calling program.
  • Every CICS program must end with a RETURN command.
  • A plain RETURN with no options simply ends the program.
  • RETURN with TRANSID and COMMAREA sets up the next execution of a pseudo-conversational program.
  • RETURN with the CHANNEL option passes a channel to the next program execution.

The three uses of RETURN

  • If the program was started by typing a transaction id, a plain RETURN ends the task and returns control to CICS.
  • If the program was invoked by a LINK, a plain RETURN sends control back to the program that issued the LINK.
  • If the program was invoked by an XCTL, a plain RETURN sends control to the program at the next higher logical level.
  • To continue a pseudo-conversational program, use RETURN with TRANSID and COMMAREA:-
    EXEC CICS RETURN TRANSID('PRGA') COMMAREA(CA-AREA) END-EXEC.
  • The TRANSID names the transaction to run when the user presses an attention key.
  • The COMMAREA data is saved and passed to the next execution through DFHCOMMAREA.

Syntax of the RETURN command

  • EXEC CICS RETURN [TRANSID(trans-id)] [COMMAREA(data-name)] [CHANNEL(channel-name)] END-EXEC.
  • TRANSID must be a 1 to 4 character transaction id defined in the PCT.
  • COMMAREA names the data area passed to the next execution of the program.
  • Use either COMMAREA or CHANNEL, not both.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant