z/OS TSO/E CLISTs
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using the RETURN CODE statement

z/OS TSO/E CLISTs
SA32-0978-00

Subprocedures can return information to the caller using the CODE option of the RETURN statement. Like return codes from TSO/E commands, return codes from subprocedures are stored in the control variable &LASTCC, but error return codes from subroutines will not cause an error routine to receive control.

In the following example, the subprocedure passes a return code to the statement following SYSCALL:
   SET &A = AL
   SYSCALL XYZ &A                /* pass variable &A to XYZ            */
   IF &LASTCC = 0 THEN + 
     WRITE All's Well!

XYZ: PROC 1 PARM1
       WRITE &PARM1
       RETURN CODE(0)
     END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014