How to Use Return Command in CICS

Return is one of the beautiful command in CICS, which passes control to other program of next higher logical level, or to CICS.

The LENGTH value in RETURN command should not be higher than the size of DFHCOMMAREA (32760 bytes max).

  • The passing CHANNEL name should have been already created. Else, it create new channel. The length of CHANNEL should be max 16 characters.

ENDACTIVITY- you no need to give this command in all the cases. Usually, when CICS business transaction services (BTS) activities is used, that time, it is required. This command completes an activity.

IMMEDIATE -This command gives high priority to the Transactions.ensures that the transaction specified in the TRANSID option is attached as the next transaction regardless of any other transactions enqueued by ATI for this terminal.
The next transaction starts immediately and appears to the operator as having been started by terminal data. If the terminal is using bracket protocol, the terminal is also held in bracket. This option is valid only on a RETURN command issued by a program at the highest logical level, that is a program returning control to CICS.

In RETURN command you can control TRANSID, but if that program, where passing control, is already defined with other TRANSID (permanent). Then priority goes to that TRANSID.

Keep Reading

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.