EXEC PGM Parameter


Note! PGM parameter can be coded only at the step level.

The PGM parameter is used to specify the program which needs to be run by the system. EXEC PGM is only used to provide the application program name.

The program name specified with PGM should be a clean compiled program ready to execute. The program can be from a member of a system library, private library (PDS or PDSE), or temporary dataset. private library (PDS or PDSE) or temporary dataset.

Syntax -

PGM={program-name}
    {*.stepname.dd-name}
    {*.stepname.proc-stepname.dd-name}
program-name Specifies the application program name.
*.stepname.dd-name Refers to a DD name that defines the program.
It refers to the program from the library created by the previous step (*.stepname.ddname).
*.stepname.proc-stepname.dd-name Refers to a DD name that defines the program.
It refers to the program from the library created by the PROC executed in the previous step (*.stepname.procstepname.ddname).

Examples -


Scenario - Executing a program.

//MTHEXMP1 JOB (META007),'PAWAN Y', MSGLEVEL=(1,1)
//STEP1   EXEC PGM=SAMPLE
//STEPLIB  DD  DSN=MTH.MY.LOADLIB,DISP=SHR

The system searches the private library MTH.MY.LOADLIB for the member named PROG1. The system reads the member into storage and executes it.