End Program (ENDPGM)
Where allowed to run:
Threadsafe: Yes
- Batch program (*BPGM)
- Interactive program (*IPGM)
Parameters
Examples
Error messagesThe End Program (ENDPGM) command specifies the end of a CL procedure. When the command is processed, it performs the same function as a RETURN command. That is, control is returned to the command immediately following the CALL command in the calling program.
The ENDPGM command is not required at the end of a CL procedure. If the last statement in a CL procedure source file is reached and no ENDPGM command is found, an ENDPGM command is assumed by the compiler.
Restrictions: This command is valid only within a CL procedure.
There are no parameters for this command.
Top
Parameters
None
Top
Examples
PGM : ENDPGMThis CL procedure is identified by a PGM command that contains no parameters and is ended by the ENDPGM command.
Top
Error messages
None
Top