MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Raaj Beginner Joined: 03 Nov 2004 Posts: 7 Topics: 3 Location: India
Posted: Wed Nov 03, 2004 11:20 pm Post subject: Bypassing a Step in JCL
I have 6 steps in a Jcl and I wanted to execute only the steps 3 & 5 How to handle this?
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
I tried using COND but it's not apt. Any other way?
Back to top
Phantom Data Mgmt Moderator Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Nov 04, 2004 1:33 am Post subject:
Raaj,
Quote:
I tried using COND but it's not apt. Any other way?
What problem are you facing using COND ? Show us your JCL, probably we can suggest a better alternative.
Did u try JCL IF ELSE conditional statements ?
Thanks,
Phantom
Back to top
Raaj Beginner Joined: 03 Nov 2004 Posts: 7 Topics: 3 Location: India
Posted: Thu Nov 04, 2004 4:09 am Post subject:
Code:
//JXY0766A JOB (999,POK),'IZER',TIME=1440,REGION=6500K,CLASS=C,
// MSGCLASS=X, MSGLEVEL=(1,1),NOTIFY=&SYSUID
//UTST1 EXEC PGM=IUAFP11,
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME1 DD DSN=JXY0766.UAT.LIUAX00.DAT1,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST2 EXEC PGM=IUAFBT1
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME2 DD DSN= JXY0766.UAT.LIUAFBT1.DAT2,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST3 EXEC PGM=IUAFPOO,
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME3 DD DSN= JXY0766.UAT.LIUAFP00.DAT3, COND=(4095,LE[/b])
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST4 EXEC PGM=IUAFX01,
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME4 DD DSN= JXY0766.UAT.LIUAFX01.DAT4,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST5 EXEC PGM=IUAJP01, COND=(4095,LE)
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME5 DD DSN= JXY0766.UAT.LIUAJP01.DAT5,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST6 EXEC PGM=IUAXP01,
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME6 DD DSN= JXY0766.UAT.LIUAXP01.DAT6,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
//UTST7 EXEC PGM=IUAFB01
//STEPLIB DD DSN=FLPVOAD.UTST.LOADLIB,DISP=SHR
//NAME7 DD DSN= JXY0766.UAT.LIUAFB01.DAT7,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL(10,10)RLSE),
// DCB=(LRECL=2400,RECFM=FB,BLKSIZE=0)
Can you tell me how to use the cond IF THEN ELSE?
Back to top
Phantom Data Mgmt Moderator Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Nov 04, 2004 6:51 am Post subject:
Raaj,
If you don't want to execute Steps 1,2,4,6,7 always then u can easily turn them off using COND=(00,LE). This will never allow the steps to execute whatsoever be the return code of previous steps (0 or non-zero value).
Here is a sample:
Code:
//UTST1 EXEC PGM=IUAFP11,COND=(00,LE)
.........
.........
//UTST2 EXEC PGM=IUAFBT1,COND=(00,LE)
.........
.........
//UTST3 EXEC PGM=IUAFPOO
.........
.........
//UTST4 EXEC PGM=IUAFX01,COND=(00,LE)
.........
.........
//UTST5 EXEC PGM=IUAJP01
..........
..........
//UTST6 EXEC PGM=IUAXP01,COND=(00,LE)
..........
..........
//UTST7 EXEC PGM=IUAFB01,COND=(00,LE)
..........
Let me know if this solves your problem.
Thanks,
Phantom
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Thu Nov 04, 2004 9:46 am Post subject:
Raaj,
Phantom's solution WILL execuete the first step as there is NO return code to check against it. so you need a ONLY cond to bypass the first step. COND=ONLY executes when the step previous to the first step Abends, but there is no step before the first step ! So, the first step that also has a COND=ONLY will never get executed. After step3 you can Don't need a ONLY clause , as there is a step3 return code which can be used to check.
Check this link which discusses the similar issue
http://www.mvsforums.com/helpboards/viewtopic.php?t=1273&highlight=cond
Code:
//UTST1 EXEC PGM=IUAFP11,COND=((0,LE),ONLY)
.........
.........
//UTST2 EXEC PGM=IUAFBT1,COND=((0,LE),ONLY)
.........
.........
//UTST3 EXEC PGM=IUAFPOO
.........
.........
//UTST4 EXEC PGM=IUAFX01,COND=(00,LE)
.........
.........
//UTST5 EXEC PGM=IUAJP01
..........
..........
//UTST6 EXEC PGM=IUAXP01,COND=(00,LE)
..........
..........
//UTST7 EXEC PGM=IUAFB01,COND=(00,LE)
..........
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Phantom Data Mgmt Moderator Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Nov 04, 2004 11:14 am Post subject:
Oops,
That was a Gr8 Catch Kolusu. Somehow missed that.
Thanks,
Phantom
Back to top
Raaj Beginner Joined: 03 Nov 2004 Posts: 7 Topics: 3 Location: India
Posted: Thu Nov 04, 2004 10:28 pm Post subject:
Hi Phantom/Kolusu,
That's really superb and Fantastic.,
Thanks a lot!!
Regards,
JR.
Back to top
PHacker Beginner Joined: 08 Sep 2004 Posts: 9 Topics: 5
Posted: Mon Nov 08, 2004 3:14 pm Post subject:
We use combinations depending on what is needed.
One, //IFA IF (JS002.RC > 4) THEN
// ENDIF
is used with return codes from particular steps.
Another, of course, is the COND in each EXEC STMT.
//JS058 EXEC PGM=I9EXPDNL,PARM=(&PYR&SDAT),TIME=5,COND=(9,LT)
We even at times make a COBOL program generate a specific COND to flag what step we want to run.
//IF1 IF RC = 1 THEN
// ENDIF
above does the JCL decision.
With the COBOL program having this:
000022 LINKAGE SECTION.
000023 01 GL-FLAG.
000024 05 WHAT-EVER PIC XX.
000025 05 THE-POINT PIC X(03).
000026 PROCEDURE DIVISION USING GL-FLAG.
000027 ******************************************************************
000028 * DRIVER MODULE *
000029 ******************************************************************
000030 A000-LOCK-AND-LOAD.
000031 IF THE-POINT = 'HBO'
000032 MOVE 1 TO RETURN-CODE.
000033 IF THE-POINT = 'GAP'
000034 MOVE 2 TO RETURN-CODE.
000035 IF THE-POINT = 'ISI'
000036 MOVE 3 TO RETURN-CODE.
000037 STOP RUN.
000038 A000-EXIT. EXIT.
And //SET1 SET GFL=GAP
does the pointer as to what is wanted out of a very long jcl to run.
Paul
Back to top
mfjin Beginner Joined: 26 Apr 2003 Posts: 94 Topics: 17
Posted: Fri Nov 19, 2004 2:35 am Post subject:
Kolusu,
Doesnt (o,le) mean
" Do not execute this step if the previous step returns an rc of less than or equal to 0?" This means if the previous step returns an rc of 12 or 16 this step will get executed. But Raaj I guess does not want these steps to be executed.
Back to top
Cogito-Ergo-Sum Advanced Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Fri Nov 19, 2004 2:41 am Post subject:
When condition is false, the step will be executed. If it evaluates to true, the step will be bypassed. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes .
Back to top
mfjin Beginner Joined: 26 Apr 2003 Posts: 94 Topics: 17
Posted: Fri Nov 19, 2004 9:19 am Post subject:
c-e-s,
That is precisely what I say. If the previous step returns an rc of 12.
condition will be set to false ( as 12 is not less than or equal to 0) and the subsequent step gets executed. But Raaj does not want this step to run at all. But the step gets executed if the previous step returns an rc that is greater than 0.
I hope I have made sense.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Back to top
Jeba Beginner Joined: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
Back to top
mfjin Beginner Joined: 26 Apr 2003 Posts: 94 Topics: 17
Posted: Fri Nov 19, 2004 12:55 pm Post subject:
got it mates...thanks a lot.
same pinch jeba...didnt know there were people who thought exactly like me.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum