JCL EXEC PARM

JCL - EXEC REGION JCL - EXEC PGM

Advertisements


The PARM parameter is used to pass the input data from job step to program.

PARM always pass the data from job step to current processing program by providing the data at the step where the program running.

If JCL needs to pass more than one sub parameter, those should be separated by comma (,) which are enclosed in parentheses/quotes.

PARM parameter can pass maximum 100 characters.

Quotes, parentheses and commas are not included in 100 characters.

Commas in the quotes/parentheses are included as part of 100 characters which are passed to the program.

The program receives the PARM data by using linkage section.

The program linkage section declaration should have a COMP field along with field to receive the actual data.

The COMP field in the program contains the length of the data passed from job step.

To add the PARM data that exceeds the first line, second line should start from 16th position.

PARM also used to pass runtime input data for the executing program.


Syntax:

PARM[.procstepname]=subparameter
PARM[.procstepname]=(subparameter,subparameter)
PARM[.procstepname]=('subparameter',subparameter)
PARM[.procstepname]='subparameter,subparameter'

subparameter Specifies the information to be passed to the processing application program.


Below diagram explains how the JCL PARM data passes to the program



Example 1:

//STEP01  EXEC PGM=SAMPLE,PARM='INPUT,123,MTH=9'

The system passes 'INPUT,123,MTH=9 to the processing program SAMPLE.


Example 2:

//   EXEC PROC=MTHPROC,PARM=MTH

The system passes MTH to the first step of the procedure MTHPROC. If MTHPROC contains more steps and their EXEC statements contain PARM parameters, the system nullifies those PARM parameters.


Example 3:

//STEP01 EXEC PROC=MTHPROC,PARM.STEP02='INPUT,123,MTH=9'

The system passes INPUT,123,MTH=9 to the procedure step STEP02 in procedure MTHPROC. If any other procedure steps in MTHPROC contain a PARM parameter, those PARM parameters remain in effect.


Example 4:

//STEP01  EXEC PGM=SAMPLE,PARM=(MAINFRAMESTECHHELP,'INPUT=77',
//        123)

The system passes MAINFRAMESTECHHELP,'INPUT=77',123 to processing program SAMPLE.


JCL - EXEC REGION JCL - EXEC PGM

Advertisements