IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cond parameter


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Sun Sep 09, 2018 2:06 am
Reply with quote

Hi,
I want to execute only two steps say step 3 and step 15 of 20 Steps given in Catalogue procedure through JCL.
I find difficulty in executing the Step 15.
First I gave Cond=(0,LE) in the Job card and restart instruction to execute from Step 3 of my PROC such that Step 3 is executed normally and following are bypassed.
For Step 15 Execution,I tried to give Cond Override Parameter for Step 15 in the job step.
//J020 EXEC PROC,COND.STEP15=(4,LT,STEP3)
This is not working as expected.
Any ideas please.

Thanks
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Sun Sep 09, 2018 3:00 am
Reply with quote

Idea #1:

Please, give any details, sample of real code (the involved parts of it), the trace of execution (with Return Codes), and clarification : what is "not working as expected"?
Back to top
View user's profile Send private message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Sun Sep 09, 2018 1:11 pm
Reply with quote

Below is the sample job which i have used for testing purpose.
I have two steps in the job namely J010 and J020.
Second Step J020 is executing a PROC named as PROCCHK having 5 steps from S010 TO S050.
I have given RESTART instruction to execute from S020 Step of PROCCHK and COND parameter as (0,LE) in the Job Card
Now,I want to run only S020 and S050 in the JOB.
When i run the job,S020 Step got executed with RC=0 and due to condition parameter in the job (0,LE),further steps are bypassed.
Condition parameter which i have overrided at the Step J020 for Procstep S050 is not working.
I want to execute by making changes only in JCL and not to touch the PROC.

Code:
//JOBNAME JOB ACCT,CLASS=9,MSGCLASS=9,RESTART=J020.S020,
                       COND=(0,LE)
//J010  EXEC PGM=IEFRB14
//         ....
//J020  EXEC PROCCHK,COND.S050=(4,LT))



Quote:
PROC DETAILS:


Code:
PROCCHK PROC
//S010 EXEC PGM=SORT
//S020 EXEC PGM=SORT
//S030 EXEC PGM=SORT
//S040 EXEC PGM=SORT
//S050 EXEC PGM=SORT

[/quote][/code]
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Sep 09, 2018 3:10 pm
Reply with quote

The easiest way, and you could have done it by now, is to copy the proc and delete the unwanted steps and executed the modified copy. Or cut and paste the two steps into a new member and make it into a job i.e. add job card etc and resolve any symbolic parameters.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Sep 09, 2018 7:09 pm
Reply with quote

You should have a procedure to run one-off production jobs. Set up your job as advised and use that process to get it run.
Back to top
View user's profile Send private message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Sun Sep 09, 2018 9:48 pm
Reply with quote

I am aware to handle the process in test jcl by keeping only two steps in the proc and run.. But if there is any solution to execute the above scenario without touching the original proc and run the test jcl with any idea.. then it is welcome... I just want to know if JCL can do such execution... If no then it ok.. If Yes then i am curious to know how..
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Sun Sep 09, 2018 11:04 pm
Reply with quote

Any testing of unclear JCL parameters MUST BE PERFORMED using truncated and simplified JCL+PROC codes, not involving any production code, or data

After all unclear issues with the behavior of COND parameters have been resolved within this simplified test, the final logic must be incorporated/updated in the production code.
Back to top
View user's profile Send private message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Sun Sep 09, 2018 11:52 pm
Reply with quote

Firstly,Only after trying as much of scenarios,i posted to know any other feasible solutions..Yes..I went through the link..But i didn't get possible answer yet.
I am just curious to solve the problem.If anyone knows any solution,please kindly share it.
All other posts are obviously basics to be understood.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Sep 10, 2018 12:03 am
Reply with quote

Quote:
When i run the job,S020 Step got executed with RC=0 and due to condition parameter in the job (0,LE),further steps are bypassed.
This is normal and expected behavior -- if you use COND on a JOB statement, when the condition is true the system bypasses all remaining steps (directly from the JCL Reference manual). So if you are expecting to be able to use a JOB COND parameter to do what you want, then what you want to do is simply not possible. The same manual says that if you code COND on a job statement and on EXEC statements, and the JOB COND is true, the system will ignore all EXEC COND statements.
Back to top
View user's profile Send private message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Mon Sep 10, 2018 12:52 am
Reply with quote

Robert Sample wrote:
Quote:
When i run the job,S020 Step got executed with RC=0 and due to condition parameter in the job (0,LE),further steps are bypassed.
This is normal and expected behavior -- if you use COND on a JOB statement, when the condition is true the system bypasses all remaining steps (directly from the JCL Reference manual). So if you are expecting to be able to use a JOB COND parameter to do what you want, then what you want to do is simply not possible. The same manual says that if you code COND on a job statement and on EXEC statements, and the JOB COND is true, the system will ignore all EXEC COND statements.


Thanks a lot.. This makes sense.. icon_idea.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Sep 10, 2018 1:17 pm
Reply with quote

Yes, it can be done but..you have to override the COND on ALL steps after the restart step. It took me all of 10 minutes to write a procedure, write the JCL deck and execute it 3 times with different condition code settings. And that time includes reading up on the JCLLIB and RESTART parameters as I have not used them for a number of years.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
No new posts Writing the output file name from a p... JCL & VSAM 7
Search our Forums:

Back to Top