Module 5: JCL PROCs Statement
Overriding Parameters in Procedure
In some cases, we may need to modify or override one or more parameters coded in the procedure. IBM provided a convenient way to override parameter instead of rewriting whole procedure. It should be remembered that the modified content of a procedure which has overrides in it are activated only for the duration of the job in which they exist; the original contents remains intact
- stepName is the step name in the job that the procedure will be executed from
- procName is the name of procedure which will be called and executed
- procStep identifies the procedure step whose parameters will be overridden
- ddName is the dd name of the DD statement having those parameters.
- One or more parameters can follow the DD operation field
Let say we have proc CATALOGE defined as follows:-
Assume, we have requirement that for one of the job we need to call above proc but DISP for file DATA1 need is OLD and for file DATA2 we have to use DSN=DEPT1.EMP1.DATA7, in such case it’s not fair to change the procedure as it is possible that is getting used in other jobs too, so in such case we can use ‘Overriding parameter’ feature provided by IBM
Here’s the JCL that needs to be written to meet our requirement specified above:-
Now, assume I have requirement for my Job such that I have to override DSN name DEPT.EMP.DATA2 and DEPT.EMP.DATA4 with DEPT.EMP.DATA22 and DEPT.EMP.DATA44 respectively. Below is JCL to achieve same:-
When you carefully observe above JCL, you will encounter that the dataset names which are not being overridden are kept blank. However, for each data set name included in the concatenation, the DD operand must be coded
- As name suggests, IBM allows nesting of procedure, which means we can call a procedure from within another procedure.
- Nesting of procedure is allowed up to 15 levels.
- Add/ override/ nullification is applicable at only one level.Meaning, if PROC1 calls PROC2 and PROC2 call PROC3, then no statement in PROC3 can be overridden from PROC1 invocation. Only PROC2 can do that.