PARM Parameter Example


Simple PARM Parameter -

Scenario1 - Passing single numeric value to the program.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP01  EXEC PGM=NEWPROG,PARM=47

Explaining Example -

We are passing input value 47 from JCL to the program NEWPROG.

Scenario2 - Passing alphanumeric value to the program.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP02  EXEC PGM=NEWPROG,PARM="TEST1"

Explaining Example -

We are passing input TEST1 from JCL to the program NEWPROG. The quotes are not considered as a part of input and input is alphanumeric.

Scenario3 - Passing multiple numeric values to the program.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP03  EXEC PROC=NEWPROG1,PARM=(47,64)

Explaining Example -

We are passing two inputs, 47 and 64, from JCL to the program NEWPROG1. Parentheses are used to group the values to specify those values belong to the PARM parameter. The comma is used to separate the values.

Scenario4 - Passing multiple alphanumeric values to the program.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP04  EXEC PGM=NEWPROG1,PARM=('TEST1','TEST2')

Explaining Example -

We are passing two inputs, TEST1 and TEST2, from JCL to the program NEWPROG1.

Scenario5 - Passing input that coded in more than two lines.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP01  EXEC PGM=PARAMP,PARM='THIS THE INPUT FROM JCL THAT IS CODED   
//             IN MORE THAN ONE LINE'                                   

Explaining Example -

We are passing 'THIS THE INPUT FROM JCL THAT IS CODED IN MORE THAN ONE LINE' from JCL to the program PARAMP.

PARM Parameter for PROCs -

Scenario1 - Passing a value to the PROC.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP01  EXEC PROC=NEWPROC,PARM=47

Explaining Example -

We are passing input value 47 to the procedure NEWPROC and assumes it has only one step.

Scenario2 - Passing a value to the STEP01 of PROC.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP02  EXEC PROC=NEWPROC,PARM.STEP01=47

Explaining Example -

We are passing input value 47 to the STEP01 of procedure NEWPROC.

Scenario3 - Passing a value to the PROC within the PROC.

Code -

----+----1----+----2----+----3----+----4----+----5----+
//STEP02  EXEC PROC=NEWPROC,PARM.PROC2.STEP02=47

Explaining Example -

We are passing input value 47 to the STEP02 of PROC2 that is coded in NEWPROC.