CONDition codes in PROC



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

CONDition codes in PROC

Postby dk1987 » Wed Feb 03, 2016 1:23 pm

Hi,

I've a catalogued proc and a jcl to invoke it.
objective: want to run few steps for some testing purpose.

question:
say, the catalaogued proc has steps - 1,2,3,4,5,6,7. I want to run only step 1 and 2.. rest of the steps should be bypassed. I know that by coding condition code as (0,LE) for step 3,4,5,6,7 can bypass all those steps. but is there some other way to bypass all the steps below step 2, (of course, not by deleting/commenting out the steps ;). the thing is I should not modify PROC). Why I need to know an alternate method because, I've to find all the step name below step 2 and put the condition code in JCL, which is time consuming. Could anyone please help me in this regard.

Thanks :)
dk1987
 
Posts: 4
Joined: Mon Feb 01, 2016 12:02 pm
Has thanked: 2 times
Been thanked: 0 time

Re: CONDition codes in PROC

 

Re: CONDition codes in PROC

Postby Aki88 » Wed Feb 03, 2016 1:55 pm

Hello,

dk1987 wrote:Why I need to know an alternate method because, I've to find all the step name below step 2 and put the condition code in JCL, which is time consuming. Could anyone please help me in this regard.


If step names is all that you're looking for, can't this be achieved without running the JCL at all?
One of the ways (remove the double-quotes during actual usage of the commands):
a. Open the JCL/PROC in question, in ISPF (option 3.4) VIEW mode
b. Type "X ALL;F ALL 'EXEC' "

The above should give you all the places where a program/EXEC (call to a PROC) is being called; if it is commented, then you can filter it as well, by simply typing: "X ALL '//*' 1", which hides all lines containing '//*' in first column; why execute the JCL at all.

Having said that, at the end of it all, you WILL have to manually add the COND parameters to each step, unless you have a tool in place to do it for you.


Edit: You can also look here.
Aki88
 
Posts: 369
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: CONDition codes in PROC

Postby swe_das » Wed Feb 03, 2016 3:13 pm

You can use IEBEDIT utility, ofcourse. you can specify the exact steps that need to be executed(provided you are not lazy enough to not know them :D)

//IEBEDITA JOB (XXXXXXXX,,,,,XXXX),' ',CLASS=T,
// MSGCLASS=Y,NOTIFY=&SYSUID
//*===========================================================
//* EXAMPLE FOR IEBEDIT UTILITY
//*===========================================================
//STEP001 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=USERID.ABC.JCLLIB(JOBNAM1),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(STEP010,STEP020)
/*
Link to another Mainframe forum removed.
swe_das
 
Posts: 1
Joined: Wed Feb 03, 2016 3:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: CONDition codes in PROC

Postby NicC » Wed Feb 03, 2016 9:34 pm

You can put a deliberate JCL error into the third step e,g, a non-existent dataset. That will abend the job.
Or you can copy the proc and delete the unwanted steps.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2681
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 102 times

Re: CONDition codes in PROC

Postby Terry Heinze » Wed Feb 03, 2016 9:35 pm

It would require a one-time change to your PROC, but if I understand you, it can be done like this:

COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 //jobname JOB (xxxxx,xxxx),'TERRY HEINZE -- xxxx',
000002 //             CLASS=B,
000003 //             MSGCLASS=H,
000004 //*  I AM 'userid.AAA.CNTL(TESTIFS)'
000005 //*  +------------------------------------------------------------+
000006 //*  |  MODIFY THE SXEXEC PARAMETERS TO {EXEC|SKIP} THE STEP      |
000007 //*  +------------------------------------------------------------+
000008 //             NOTIFY=&SYSUID
000009 //*
000010 //TESTPROC PROC
000011 //*
000012 //SX      EXEC PGM=IEFBR14
000013 //*
000014 //         IF &S1EXEC THEN
000015 //S1      EXEC PGM=IEFBR14
000016 //         ENDIF
000017 //*
000018 //         IF &S2EXEC THEN
000019 //S2      EXEC PGM=IEFBR14
000020 //         ENDIF
000021 //*
000022 //         IF &S3EXEC THEN
000023 //S3      EXEC PGM=IEFBR14
000024 //         ENDIF
000025 //*
000026 //         IF &S4EXEC THEN
000027 //S4      EXEC PGM=IEFBR14
000028 //         ENDIF
000029 //*
000030 //         IF &S5EXEC THEN
000031 //S5      EXEC PGM=IEFBR14
000032 //         ENDIF
000033 //*
000034 //         IF &S6EXEC THEN
000035 //S6      EXEC PGM=IEFBR14
000036 //         ENDIF
000037 //*
000038 //         IF &S7EXEC THEN
000039 //S7      EXEC PGM=IEFBR14
000040 //         ENDIF
000041 //*
000042 //         PEND
000043 //*
000044 //PROCTEST EXEC TESTPROC,
000045 //             S1EXEC='(RC EQ 0000)',  <---  EXEC THIS STEP
000046 //             S2EXEC='(RC EQ 0000)',  <---  EXEC THIS STEP
000047 //             S3EXEC='(RC LT 0000)',  <---  SKIP THIS STEP
000048 //             S4EXEC='(RC LT 0000)',  <---  SKIP THIS STEP
000049 //             S5EXEC='(RC LT 0000)',  <---  SKIP THIS STEP
000050 //             S6EXEC='(RC LT 0000)',  <---  SKIP THIS STEP
000051 //             S7EXEC='(RC LT 0000)'   <---  SKIP THIS STEP
000052 //
.... Terry
Terry Heinze
 
Posts: 190
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: CONDition codes in PROC

Postby dk1987 » Thu Feb 04, 2016 2:38 pm

Thanks all for the reply/suggestion.. :) Thats the beauty of these type of forums. you got to know how to approach a problem in different ways/perception - good learning.

But reading all the comments, i think there is no better alternate than coding COND code. may be a tool to automate that would only help to avoid extra coding time or as Akki88 quoted, need to find some 'ways' to reduce the overall time.
dk1987
 
Posts: 4
Joined: Mon Feb 01, 2016 12:02 pm
Has thanked: 2 times
Been thanked: 0 time

Re: CONDition codes in PROC

Postby NicC » Thu Feb 04, 2016 8:41 pm

If this is a regular thing then create a new proc with only the required steps and run that instead of the other one when required.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2681
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 102 times

Re: CONDition codes in PROC

Postby prino » Fri Feb 05, 2016 1:46 pm

Set up all new JCL with logical step names, i.e.

SA001
SA002
SA003
SA004

And code IF-THEN-ENDIF statements around them with logical RC's, i.e.

IF RC &RC001 THEN

and by changing the default variables from

RC001='= 0'

to

RC001='= 0 & RC001=1'

You can very easly do what you want to do...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 529
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 20 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post