PROC parameters substitution (COPY)

Top  Previous  Next

JCLs coming from MVS, OS/390 and z/OS can make use of dynamic override for PROC parameters and DD. Cataloged PROCs, are converted in Javascript functions and to replicate the dynamic ovveride features, the ProcParm objects is provided.

First of all, the object for the PROC parameter must be instantiated, through the createProcParm function, then the object retrieved may be used to override DD definitions and parameters. Once done, the PROC is invoked with the function invoke providing the parameter object. I.e.

pi=createProcParm();
pi.dd("STEP02", "FILEIN", "FILEIN.txt,cat=FLATCAT,disp=(OLD,KEEP),type=flat");
pi.dd("STEP02", "FILAZZO","jdd.ddd");
pi.setProcCond("RC > 8");
pi.setParm("PARAM1", "DAJOB");
pi.dd("STEP02", "SYSIN",
       "PTR001"+NL+
       "PTR002"+NL
);
invoke("PROC1", pi);

Overriding DD

The DD definition of the called PROC may be overridden with the dd method of the ProcParm object. The method parameters are:

the name of the step where to perform the override
the name of the file DD to override
the file link value string

I.e.

pi.dd("STEP02", "FILEIN", "FILEIN.txt,cat=FLATCAT,disp=(OLD,KEEP),type=flat");

Overriding parameters

The parameters of a PROC may be overridden in the job by the method setParm of the ProcParm object. The method parameter are:

parameter name
parameter value

I.e.

pi.setParm("P1", "5");

In the PROC, parameters are retrieved using the getParm method of the ProcParm object. The method parameter are:

parameter name
parameter default value

function PROC1(parms) {
   proc("PROC1", parms);
   var P1=parms.getParm("P1", "0");