Executing a Proclib within a Proclib with over rides

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
20sam13
Member
Posts: 6
Joined: Wed Feb 13, 2013 6:44 pm
Location: United States

Executing a Proclib within a Proclib with over rides

Post by 20sam13 » Wed Feb 13, 2013 7:04 pm

Hello eveyone...

This is the first shop I have ever worked in that has a main proclib member that executes another proclib member to perform a sort.

What I am trying to figure out is how to do this, but code in the JCL an override for any of the DDcards in the sort proclib member.

I am aware that from the JCL one can code:
proclibstep.ddcard dd DSN=
or
proclibstep.sysin dd dsn=
etc..
etc..

I am seeking your assistance to figure out how to code an override to accomplish something like:

JCL member
//jobname job (accounting stuff),'comment',
// notify=me,
// class=runin,
// msglevel=(x,y),
// msgclass=a
//proclib jclliborder=(my.proclib, test.proclib, prod.proclib)
//joblib dd dsn=prod.loadlib,disp=shr
// dd dsn=db2.alias.prod.dsnload,disp=shr
// include member=otherlib
//
//step10 exec proc1
//procst10.sysin dd dsn=sortcard,disp=shr

proc1 member

//proc1 proc,
// parm1=dummy,
// parm2=dummy
//procst10 exec pgm=something
//sortin dd dsn=in,disp=shr
//sortout dd dsn=out,disp=(new,catlg,delete),
// recfm=*.sortin,
// space=(trk,(5,5),rlse)
//sysin dd dsn=prod.sortin(prodsort),disp=shr
:
:
:
//procst50 exec sort
//sortin dd dsn=in2,disp=shr
//sortout dd dsn=out2,disp=(new,catlg,delete),
// recfm=*.sortin2,
// space=(trk,(5,5),rlse)
//sysin dd dsn=prod.sortin2(prodsrt2),disp=shr


*** It would be the different dd cards in the //procst50 exec sort that I am seeking to override from the JCL.


Does this make sense?

Thanks!

PS... I "scoured" the web for an answer/example, but did not quite enter the right search terms to find one.
Scott M

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Feb 13, 2013 7:38 pm

Can you show the SORT PROC, please, in the Code tags to preserve spacing/improve readability.

20sam13
Member
Posts: 6
Joined: Wed Feb 13, 2013 6:44 pm
Location: United States

Over ride dd cards in a proc executed by a proc....

Post by 20sam13 » Wed Feb 13, 2013 9:15 pm

William Collins wrote:Can you show the SORT PROC, please, in the Code tags to preserve spacing/improve readability.

Code: Select all

//SORTGWC  PROC OUTC='*',      SYSOUT CLASS
//         PRIM1='1',          SORTWK01 PRIMARY CYLINDERS
//         SEC1='1',           SORTWK01 SECONDARY CYLINDERS
//         PRIM2='1',          SORTWK02 & 03 PRIMARY CYLINDERS
//         SEC2='1',           SORTWK02 & 03 SECONDARY CYLINDERS
//*        DB2SYS=xxxx,        DB2 REGION - PROD
//         DB2SYS=yyyy,        DB2 REGION - TEST
//*        DB2LVL=x            DB2 LEVEL - PROD
//         DB2LVL=y            DB2 LEVEL - TEST
//SORT1    EXEC PGM=SORT,REGION=64M
//STEPLIB  DD  DISP=SHR,DSN=&DB2LVL.DB2&DB2SYS..DB2.SDSNLOAD
//SYSOUT   DD SYSOUT=&OUTC
//DONTWK01 DD DUMMY,SPACE=(CYL,(&PRIM1,&SEC1))
//DONTWK02 DD DUMMY,SPACE=(CYL,(&PRIM2,&SEC2))
//DONTWK03 DD DUMMY,SPACE=(CYL,(&PRIM2,&SEC2))
I might have just seen what I need to use to actually reference it from the JCL.

I was coding an override as:

Code: Select all

//procstep.sort.sysin dd dsn=

I probably need to code as:
//sortgwc.sysin dd dsn=
//sortgwc.sortin dd dsn=
//sortgwc.sortout dd dsn=
Lastly, remind an "old horse" who has forgotten. If the override has multiple items (ie: sortin is bringing in multiple files), I just code the first procstep.ddcard dd dsn= followed by a new line with // and spacing over to the dd and typing the next part, correct?

Code: Select all

//sortgwc.sortin dd dsn=file1,disp=shr
//                      dd dsn=file2,disp=shr
//                     dd dsn=file3,disp=shr
//sortgwc.sort01 dd dsn=out1,
//                         disp=(new,catlg,delete),
//                         dcb=(recfm=fb,lrecl=2000,blksize=0,dsorg=ps),
//                         space=(trk,(5,5),rlse)
Scott M

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Feb 13, 2013 9:43 pm

Although it is in a PROC, it is still the "step" that you are overriding.

Code: Select all

//sort1.sortin dd dsn=file1,disp=shr
//                      dd dsn=file2,disp=shr
//                     dd dsn=file3,disp=shr
//sort1.sort01 dd dsn=out1,
//                         disp=(new,catlg,delete),
//                         dcb=(recfm=fb,lrecl=2000,blksize=0,dsorg=ps),
//                         space=(trk,(5,5),rlse) 
I'd ditch the DCB for sort01 (did you mean SORTOUT?, or is it an OUTFIL dataset?) as Sort will provide it for you, meaning it only gets done in one place (an you can change the sort cards by one byte without having to worry about changing the JCL).

20sam13
Member
Posts: 6
Joined: Wed Feb 13, 2013 6:44 pm
Location: United States

over ride ddcards for a proc called by a proc

Post by 20sam13 » Wed Feb 13, 2013 10:14 pm

JCL step that executes the 1st proclib:

Code: Select all

//STEP0020 EXEC proc1,
//         SYS1=xxxx,
//         SYS2=x,
//         DATAIN=input1,
//         XREF=xxx,
//         INRECL=2000,
//         DB2SYS=xxxx,
//         SFX=D021313.T160800
//*
//STPR0060.TOOLIN DD DSN=TEST.SYSIN(toolin1),DISP=SHR

I apologize, I should have shown the original first-level proclib step:

proc1
:
:
:

Code: Select all

//STPR0070 EXEC SORT
//*=========================================================//*
//SORTIN   DD   DSN=input1,
//             DISP=SHR
//*
//SORTOUT  DD   DSN=output1,
//             DATACLAS=STANDSEQ,
//             DCB=(RECFM=FB,LRECL=&INRECL,BLKSIZE=0),
//             DISP=(NEW,CATLG,DELETE)
//*
//SYSIN    DD DISP=SHR,DSN=PROD.SYSIN(sortcard)
//*
//SYSOUT   DD  SYSOUT=*
//*

sort proc being executed by above proclib step:

Code: Select all

//SORTGWC  PROC OUTC='*',      SYSOUT CLASS 
//         PRIM1='1',          SORTWK01 PRIMARY CYLINDERS 
//         SEC1='1',           SORTWK01 SECONDARY CYLINDERS 
//         PRIM2='1',          SORTWK02 & 03 PRIMARY CYLINDERS 
//         SEC2='1',           SORTWK02 & 03 SECONDARY CYLINDERS 
//         DB2SYS=yyyy,        DB2 REGION - TEST 
//         DB2LVL=y            DB2 LEVEL - TEST 
//SORT1    EXEC PGM=SORT,REGION=64M 
//STEPLIB  DD  DISP=SHR,DSN=&DB2LVL.DB2&DB2SYS..DB2.SDSNLOAD 
//SYSOUT   DD SYSOUT=&OUTC 
//DONTWK01 DD DUMMY,SPACE=(CYL,(&PRIM1,&SEC1)) 
//DONTWK02 DD DUMMY,SPACE=(CYL,(&PRIM2,&SEC2)) 
//DONTWK03 DD DUMMY,SPACE=(CYL,(&PRIM2,&SEC2)) 
Would I need to code in the JCL step:

Code: Select all

//sortgwc.stpr0070.sysin dd dsn=test.sysin(sortcard),disp=shr
Now I feel better about giving all of the facts & info in one msg to the board.
[/code]
Scott M

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Feb 13, 2013 10:48 pm

Why don't you stick a TYPRUN=SCAN on the JOB card and let it rip? If that doesn't answer, post the relevant parts of the translated JCL.

I'm getting confused. How do you get from EXEC SORT to a PROC named SORTGWC?

What is it that you want to override?

20sam13
Member
Posts: 6
Joined: Wed Feb 13, 2013 6:44 pm
Location: United States

over ride ddcards for a proc called by a proc

Post by 20sam13 » Thu Feb 14, 2013 12:25 am

I do apologize.

JCL(job1) executes a PROCLIB(proc1) which executes/calls a sort PROCLIB(sort).

JCL (job1)

Code: Select all

//step0010 exec proc1
PROCLIB (proc1)

Code: Select all

//proc1 proc
:
:
//stpr0080 exec sort
PROCLIB (sort)

Code: Select all

//sortgwc proc
:
:
I am wanting to figure out how I can override 1 or more of the ddcards in the PROCLIB (sort) from the JCLLIB (job1).

Understanding that usually one just codes something like the following to override a ddcard in the PROCLIB (proc1):
//procstep.ddcard override information

My goal is to override one or more ddcards in the 3rd level PROCLIB (sort).

So, do I code it like the following in the JCLLIB (job1) following the execution stmnt of the PROCLIB (proc1):

//proc1step.ddcard dd "override statement"
or
//proc1step.sortproc.ddcard dd "override statement"
or
//sortproc.proc1step.ddcard dd "override statement"
[/code]
I'm pretty sure I will get it explained correctly soon. I hope it is with this post so I don't aggrevate you or anyone else, futher.

Thanks!
Scott M

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others