What is the use of PGM and ENDPGM in CL program

PGM and ENDPGM in CL program:
 
In this blog post, we will see what is the use of PGM and ENDPGM commands in a CL program. First, we will start with the PGM command.
 
PGM Command:
  • In general, the PGM command is written to identify the beginning of a CL program.
  • Example:
PGM Command
  • It is an optional command but becomes mandatory only when we are receiving parameters from external programs.
  • It is mandatory to specify the parameter in the PGM command if the program accepts input parameters.
  • Example:
    •  In the below program, we are accepting 2 parameters from the calling program. So it is a must to specify in the PGM command.
Parameters in PGM command
    • Here &name and &age are parameters from the calling program.
ENDPGM Command
  • ENDPGM is written to identify the end of a CL program.
  • This is also an optional command. 
  • Example:
ENDPGM command

No comments:

Post a Comment

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...