Health IT and Electronic Health Activate your FREE membership today |  Log-in
5 pts.
 How do you do a PROC overriding a PROC in JCL?
We have PROC's inside of PROC's in our JCL, how do you override the inner proc?



Software/Hardware used:
Mainframe / Passport
ASKED: June 4, 2011  12:27 AM
UPDATED: September 29, 2011  5:07 pm

Answer Wiki:
Ok, I have to admit that I had to do some googling to figure out what a Proc and JCL is, but the only this I got close to an answer was in this web site: <a href="http://www.simotime.com/jclprc01.htm"></a>. I hope it gets you closer to the answer you are looking for. I am glad I learned couple of new terms though. I am also curious to see what application you are using on the mainframe and if it is a healthcare application.
Last Wiki Answer Submitted:  July 3, 2011  9:25 pm  by  RedaChouffani   1,785 pts.
All Answer Wiki Contributors:  RedaChouffani   1,785 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Several options come to mind, but finding and using the override library concatenation of your site sounds like the easiest option.

What I think you’re describing is your JCL EXEC statement calls a PROC and, within the directly called PROC, one of the job steps calls another PROC. I assume you either want to override the call or modify the second proc itself from your main proc.

So, just to refresh my memory and be sure we’re on the same page (it’s been a few years since I worked the big iron :) ), when the mainframe prepares to run a JCL card, it uses the steplib (library) statement at the top of the JCL to gather all the programs, procs, sysins and datains the card will use. If those aren’t resolvable, the job will fail before it enters the execution queue. The steplib controls the search path for libraries where the system expects to find its code objects. It’s common for shops to have different concatenation orders for development and production environments so code can be tested before it’s released into production.

If those objects are all found, the JCL is expanded (echoed in the sysout) into one complete job comprised of all the references and paths in all the procs. That can be run and any subsequent job failure will be caused by errors within any of those job steps.

So, if you want to override a step in the JCL or proc, you can usually add an override step within the scheduled JCL, right below the EXEC statement, to feed in override parameters as needed.
E.g.,
//JS10 EXEC PROC(PARENT_PROC)
//PS20 EXEC PROC(YOURNEWPROC),PARM1=FOO, PARM2=BAR,
//ps20.STEPLIB=SOMELIB
//ps20.DD filename DSN=SOMENEWFILE,DISP=SHR

Whether this works neatly depends on whether your child-of-a-child PROC has distinctly named proc steps that you can override in the parent JCL. If it doesn’t you’ll have to qualify by proc name and job step (there’s a way you can reference the step within the proc, something like “//PROCNAME.JS10 DD DSN=….” but I don’t have a JCL library anymore. Search an IBM Redbook online for the exact syntax). Also, your proc step override will have to include everything you need to for the exec statement to replace that entire line of the JCL. Bear in mind, you can use overrides to add references to a proc step, but an override can’t remove unneeded items. Even if you override a file reference as DD DUMMY, the file data definition will still be passed into the program’s file connection so, if your program changed and no longer has a file definition, any job card override would have to override the definition of the entire job step and remove the reference.

Regardless, in order to implement this temporary change to production JCL, you’ll need an override (a.k.a. “fixlib”) in your library concatenation anyway so your OS finds and uses the modified version of the JCL first. Otherwise, the production JCL–with the proc you’re going to override–will be loaded to the queue anyway in place of your change.

So the easiest temporary solution is to talk to your developers and find the fixlib path for PROCs. All the permanent procs will be living in the production proclib, and there will be a smaller collection in a closely monitored fixlib for overrides to the batch job cycle. If you want to change how the grandchild proc is called from the main proc, you’d change the calling line in the parent proc so it calls your child the way you want, and check that change back into the PROC FIXLIB. Note, you’d have a copy of the entire parent proc (since this is what your JCL calls), with changes in one line. Often people will add a maintenance history comment in the top of the proc so to document what changed, who changed it, and how long this override is to exist. Then, when your JCL calls the parent proc, it will pull in the overridden version with changes in how the grandchild proc is called.

If you want more significant changes to the grandchild proc itself, check out the grandchild proc, make changes to your heart’s content, and check that back into the fixlib. When the parent proc calls the child proc, it will pull the grandchild out of fixlib and run that in the job. If it happens that your grandchild proc is a system level proc rather than a custom one, you’ll have to find a good coder there and ask how to do this. System procs for sorting, common utilities, etc. didn’t have developer fixlibs in my previous workplaces, but I believe those libraries were searched last for the object name so you might be able to work around by cloning the system proc into a developer one of the same name and placing that into fixlib. Or connect with your system administrator and try to get a custom version (with a new name) for your own purposes. System wide changes are tightly controlled.

As a best practice, your shop might have limits how long a change is allowed to run from FIXLIB (maybe even someone monitoring the library and clearing it weekly) before the change either has to be reverted or code reviewed for a permanent system change. This is a quality control measure to ensure the production cycle code goes through the proper approvals and code review. Thus, when you figure out your change, expect to be asked whether this a permanent or limited time change to the proc.

 10 pts.

 

That’s an interesting answer. Thanks for posting.

 0 pts.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: