End Program (ENDPGM)

The End Program (ENDPGM) command specifies the end of a CL program or ILE 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 program or ILE CL procedure. If the last statement in a CL program or ILE 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 program or ILE CL procedure.

There are no parameters for this command.

Parameters

None

Examples

PGM
 :
ENDPGM

This CL program or ILE CL procedure is identified by a PGM command that contains no parameters and is ended by the ENDPGM command.

Error messages

None