Execute a specific step in a JCL.

All sort of Mainframes Interview Questions.
Post Reply
Shaifali Kapoor
New Member
Posts: 5
Joined: Sun Jun 07, 2015 11:08 pm

Execute a specific step in a JCL.

Post by Shaifali Kapoor »

Hi,

In a JCL which have 100 steps. In that, if I want to execute only the 13th step then I can by using RESTART=STEP13 in the job card. I alos need to put a null statement after the 13th step. Is there any other way to do this? I do not a way of doing it. Can there beother way, please suggest me. I faced this in an iterview which went almost good apart from this question.
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: Execute a specific step in a JCL.

Post by Akatsukami »

First of all, realize that this a trick question; you'd seldom if ever want to do this in real life.

Possible ways of doing this would be:
  • Deleting all lines after STEP13, and either using the TSO SUBMIT command or writing the modified JCL to the internal reader, depending on the environment.
  • Enclosing STEP14 through STEP100 in a suitable IF-THEN-ELSE construct.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: Execute a specific step in a JCL.

Post by Chandan Yadav »

Hi,

Just adding one more way to Akatsukami..
Code

Code: Select all

Restart =STEP13,COND=(0,LE)  
on Job card
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 837
Joined: Wed Sep 11, 2013 3:57 pm

Re: Execute a specific step in a JCL.

Post by enrico-sorichetti »

and ... what would be a practical use of this horse manure(*)


(*)
normally horse manure would be much more useful than these kind of gimmiks
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Shaifali Kapoor
New Member
Posts: 5
Joined: Sun Jun 07, 2015 11:08 pm

Re: Execute a specific step in a JCL.

Post by Shaifali Kapoor »

Akatsukami wrote: First of all, realize that this a trick question; you'd seldom if ever want to do this in real life.

Possible ways of doing this would be:
  • Deleting all lines after STEP13, and either using the TSO SUBMIT command or writing the modified JCL to the internal reader, depending on the environment.
  • Enclosing STEP14 through STEP100 in a suitable IF-THEN-ELSE construct.
Thanks for the other options. I have ore answer for the interview. :)
Shaifali Kapoor
New Member
Posts: 5
Joined: Sun Jun 07, 2015 11:08 pm

Re: Execute a specific step in a JCL.

Post by Shaifali Kapoor »

enrico-sorichetti wrote: and ... what would be a practical use of this horse manure(*)


(*)
normally horse manure would be much more useful than these kind of gimmiks
Not sure what do you want to say. I was just thimking if I can prepare better for next interview. Please advise if I should have asked it some other forum?
Shaifali Kapoor
New Member
Posts: 5
Joined: Sun Jun 07, 2015 11:08 pm

Re: Execute a specific step in a JCL.

Post by Shaifali Kapoor »

Chandan Yadav wrote: Hi,

Just adding one more way to Akatsukami..
Code

Code: Select all

Restart =STEP13,COND=(0,LE)  
on Job card
Thanks for the other option Chandan. But if add only this steps after 13 will anyways get executed?
Preeti Ganesh
New Member
Posts: 9
Joined: Thu Jan 21, 2016 12:16 pm

Re: Execute a specific step in a JCL.

Post by Preeti Ganesh »

Hi,

We can also make use of IEBEDIT.
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: Execute a specific step in a JCL.

Post by Chandan Yadav »

Shaifali Kapoor wrote: thanks for the other option Chandan. But if add only this steps after 13 will anyways get executed?
Once your step 13 executed with Restart parameter then COND parameter on JOb card will be applicable to all other steps and (0,LE) will be always true
msivakarthikmf
Job-Opening Moderator
Job-Opening Moderator
Posts: 1
Joined: Fri Jul 22, 2016 5:42 pm

Re: Execute a specific step in a JCL.

Post by msivakarthikmf »

This would include Step name STEP010 of Jcl JOBNAM1 present in library
USERID.ABC.JCLLIB

Code: Select all

//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)                       
/*
Preeti Ganesh
New Member
Posts: 9
Joined: Thu Jan 21, 2016 12:16 pm

Re: Execute a specific step in a JCL.

Post by Preeti Ganesh »

msivakarthikmf wrote: This would include Step name STEP010 of Jcl JOBNAM1 present in library
USERID.ABC.JCLLIB

Code: Select all

//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)                       
/*
Thanks. Ido see IEBEDIT answer on many places on websites but in my real JCLS I have at work place I have never seen it being used. Is it used only in theory and for interviews?
Preeti Ganesh
New Member
Posts: 9
Joined: Thu Jan 21, 2016 12:16 pm

Re: Execute a specific step in a JCL.

Post by Preeti Ganesh »

Chandan Yadav wrote:
Shaifali Kapoor wrote: thanks for the other option Chandan. But if add only this steps after 13 will anyways get executed?
Once your step 13 executed with Restart parameter then COND parameter on JOb card will be applicable to all other steps and (0,LE) will be always true
COND=(0,LE) is like, if the RC of the previous step is less than 0 don't execute "step13", which is not possible. So agree step13 would execute but rest of the steps will also execute. I was not supposed to execute step15, step15...
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Execute a specific step in a JCL.

Post by nicc »

IEBEDIT is a standard IBM utility. Refer to the utilities manual for information.
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1900
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Execute a specific step in a JCL.

Post by Robert Sample »

COND=(0,LE) is like, if the RC of the previous step is less than 0 don't execute "step13", which is not possible. So agree step13 would execute but rest of the steps will also execute. I was not supposed to execute step15, step15...
A job COND parameter applies to all steps, so the COND=(0,LE) would apply to all steps after STEP13.
Chandan Yadav
Website Team
Website Team
Posts: 70
Joined: Wed Jul 31, 2013 10:19 pm

Re: Execute a specific step in a JCL.

Post by Chandan Yadav »

Preeti Ganesh wrote: COND=(0,LE) is like, if the RC of the previous step is less than 0 don't execute "step13", which is not possible. So agree step13 would execute but rest of the steps will also execute. I was not supposed to execute step15, step15...
As Robert mentioned When I mention COND on JOB parameter it will applicabe to all steps of Jobs, as I am restarting from step 13 it will anyways execute as there is no previous COND parameter to check.
Once Step 13 executed it will apply COND=(0,LE) to all other steps and COND=(0,LE) is like the RC of the previous step is less than or equal to 0 don't execute

I hope its clear else I can suggest you to test it out and let us know if something not working :)

Thanks,
Chandan
Post Reply

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

Register

Sign in

Return to “Interview Questions.”