JCL EXEC PGM

JCL - EXEC PARM JCL - EXEC PROC

Advertisements


PGM parameter is used to specify the program name the system is to execute.

PGM parameter also requests the syntax check without executing for JES3.

PGM parameter is used to identify the program which needs to execute by the system.

EXEC PGM is only used to provide application program name.

The program name specified with PGM must be a member of system library (PDS or PDSE) or private library (PDS or PDSE) or temporary dataset.


Syntax:

PGM= {program-name                  }
     {*.stepname.ddname             }
     {*.stepname.procstepname.ddname}
     {JCLTEST                       }
{JSTTEST                       }

AttributeDescription
program-name Specifies the application program name

The program name is of length 8 characters.

The program name allows alphanumeric or national characters.

The first character must be alphabetic or national.

*.stepname.ddname Refers to a DD name that defines the program to be executed as a member of PDS or PDSE or a temporary dataset.

This referring is to execute the program from the library which is created by the previous step (*.stepname.ddname).

Use this form of the parameter when a previous job step creates a temporary library to store a program until it is required.

Refer the below examples to understand better.

*.stepname.procstepname.ddname Refers to a DD name that defines the program to be executed as a member of PDS or PDSE or a temporary dataset.

This referring is to execute the program from the library which is created by the PROC which is executed in previous step (*.stepname.procstepname.ddname).

Use this form of the parameter when a previous job step creates a temporary library to store a program until it is required.

Refer the below examples to understand better.

JCLTEST (JES3 only)
JSTTEST (JES3 only)
Scan for the syntax without executing the job.

It also request for the scan without allocating the devices.

JCLTEST or JSTTEST provides the same function for a step as provided by the JOB statement TYPRUN=SCAN parameter for a job.


Example 1:

// 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 SAMPLE. System reads the member into storage and executes the member.


Example 2:

// MTHEXMP2 JOB (META007),'PAWAN Y', CLASS=A
//CREATEL EXEC PGM=IEWL
//SYSLMOD DD   DSNAME=&&MTHDS(PROG1),
//		  UNIT=3390,DISP=(MOD,PASS),
//             SPACE=(100,(50,20,1))
//EXECPROG     EXEC PGM=*.CREATEL.SYSLMOD

The EXECPROG EXEC statement contains a backward reference to DD statement SYSLMOD in the CREATEL step. Program PROG1 is a member of the temporary PDS &&MTHDS. Step EXECPROG executes program PROG1.


Example 3:

// MTHEXMP3 JOB (META007),'PAWAN Y', CLASS=A
//STEP01 EXEC PROC=MTHPROC
//STEP02 EXEC PGM=*.CREATEL.SYSLMOD
.
.
.
//MTHPROC PROC
//CREATEL EXEC PGM=IEWL
//SYSLMOD DD   DSNAME=&&MTHDS(PROG1),
//		  UNIT=3390,DISP=(MOD,PASS),
//             SPACE=(100,(50,20,1))
//PEND

The STEP01 EXEC statement executed MTHPROC which created the temporary PDS &&MTHDS. The STEP02 contains a backward reference to DD statement SYSLMOD in the CREATEL step of MTHPROC procedure. Program PROG1 is a member of the temporary PDS &&MTHDS. Step STEP02 executes program PROG1.


JCL - EXEC PARM JCL - EXEC PROC

Advertisements