Execute a specific step in a JCL.

All sort of Mainframes Interview Questions.
Previous topicNext topic

Topic Author
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 » Wed Aug 17, 2016 2:29 pm

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: 117
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

Re: Execute a specific step in a JCL.

Post by Akatsukami » Wed Aug 17, 2016 2:57 pm

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: 69
Joined: Wed Jul 31, 2013 10:19 pm
Zodiac: Libra

Re: Execute a specific step in a JCL.

Post by Chandan Yadav » Wed Aug 17, 2016 11:39 pm

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: 869
Joined: Wed Sep 11, 2013 3:57 pm

Re: Execute a specific step in a JCL.

Post by enrico-sorichetti » Thu Aug 18, 2016 12:53 am

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-)


Topic Author
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 » Fri Aug 19, 2016 2:02 pm

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. :)




Topic Author
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 » Fri Aug 19, 2016 2:03 pm

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?




Topic Author
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 » Fri Aug 19, 2016 2:05 pm

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 » Fri Aug 19, 2016 2:24 pm

Hi,

We can also make use of IEBEDIT.




Chandan Yadav
Website Team
Website Team
Posts: 69
Joined: Wed Jul 31, 2013 10:19 pm
Zodiac: Libra

Re: Execute a specific step in a JCL.

Post by Chandan Yadav » Fri Aug 19, 2016 5:51 pm

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 » Fri Aug 19, 2016 7:45 pm

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 » Mon Aug 22, 2016 1:53 pm

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 » Mon Aug 22, 2016 1:57 pm

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: 578
Joined: Wed Apr 23, 2014 8:45 pm

Re: Execute a specific step in a JCL.

Post by nicc » Mon Aug 22, 2016 6:06 pm

IEBEDIT is a standard IBM utility. Refer to the utilities manual for information.


Regards
Nic

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1328
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Execute a specific step in a JCL.

Post by Robert Sample » Mon Aug 22, 2016 6:21 pm

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: 69
Joined: Wed Jul 31, 2013 10:19 pm
Zodiac: Libra

Re: Execute a specific step in a JCL.

Post by Chandan Yadav » Mon Aug 22, 2016 10:21 pm

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



Previous topicNext topic

Return to “Interview Questions.”