Hi,
Here is how the question goes:
"Can we code a step in a JCL so that it actually never executes? The condition is we do not want to use the condition codes. We probably never do such a thing in production but it's an interview."
I was not able to answer this question, can somebody please help me to find an answer for this.
Code a step in a JCL so that it actually never executes.
-
- New Member
- Posts: 7
- Joined: Wed Jan 20, 2016 12:26 am
-
- Website Team
- Posts: 70
- Joined: Wed Jul 31, 2013 10:19 pm
Re: Code a step in a JCL so that it actually never executes.
Having COND=(0,LE) on corresponding step will suffice for bypassing the step
Thanks and regards,
Chandan
Thanks and regards,
Chandan
- Robert Sample
- Global Moderator
- Posts: 1891
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Code a step in a JCL so that it actually never executes.
Chandan, did you miss this in the original post?
Krishna, JCL supports the IF statement to allow conditional execution of one or more steps. Read up on it in the JCL Reference manual so you'll be better prepared for your next interview.
Your "solution" uses condition codes, which is precisely what is NOT needed.The condition is we do not want to use the condition codes.
Krishna, JCL supports the IF statement to allow conditional execution of one or more steps. Read up on it in the JCL Reference manual so you'll be better prepared for your next interview.
-
- New Member
- Posts: 7
- Joined: Wed Jan 20, 2016 12:26 am
Re: Code a step in a JCL so that it actually never executes.
Yes, we don't need to use COND, with that I knew the answer. Thanks. I think this should been the answer:Robert Sample wrote: Chandan, did you miss this in the original post?Your "solution" uses condition codes, which is precisely what is NOT needed.The condition is we do not want to use the condition codes.
Krishna, JCL supports the IF statement to allow conditional execution of one or more steps. Read up on it in the JCL Reference manual so you'll be better prepared for your next interview.
Code: Select all
//somejob JOB
//S1 EXEC PROCNAME
//CONDEX IF RC = 0 THEN
//CONSTEP EXEC PGM=PGM1
//CONELSE ELSE
//CONESTP EXEC PROCNAME1
// ENDIF
Last edited by Anuj Dhawan on Tue Aug 02, 2016 9:57 pm, edited 1 time in total.
Reason: Added code tags.
Reason: Added code tags.
- Robert Sample
- Global Moderator
- Posts: 1891
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Code a step in a JCL so that it actually never executes.
Sicne IEFBR14 always sets the return code to zero, this would meet the request:The program or procedure for STEP2 will never be executed.
Code: Select all
//STEP1 EXEC PGM=IEFBR14
// IF RC > 0 THEN
//STEP2 EXEC ...
// ENDIF
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute