Where allowed to run:
|
Parameters Examples Error messages |
The Subroutine (SUBR) command is used in a CL procedure, along with the End Subroutine (ENDSUBR) command, to delimit the group of commands that define a subroutine. The SUBR command defines the start of a subroutine. Subroutines may not be nested; therefore, an ENDSUBR command must end the current subroutine before the next SUBR command starts a new subroutine. A label specified on a SUBR command, or on a null command preceding the SUBR command, can be used as a target for a Go To (GOTO) command defined in the same subroutine. This GOTO command, when run, will pass control to the first executable statement in the subroutine.
Restrictions:
Top |
Specifies the subroutine name. This is the name that must be specified on a Call Subroutine (CALLSUBR) command.
This is a required parameter.
Top |
PGM : SUBR SUBR1 : ENDSUBR ENDPGM
This SUBR command defines the start of a subroutine named SUBR1.
Top |
None
Top |