Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Executing only one step in a Job

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Amit Manas Dubey
Currently Banned

New User


Joined: 15 Dec 2006
Posts: 22
Location: Mumbai

PostPosted: Mon Jan 29, 2007 5:22 pm    Post subject: Executing only one step in a Job
Reply with quote

I have a job which has three Steps. I want to execute Step 2 only.

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

rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon Jan 29, 2007 5:34 pm    Post subject:
Reply with quote

Use restart parameter to run from step 2 and comment step 3

or comment step 1 and step 3 and run job..

hope it is one time request

Regards,
JR
Back to top
View user's profile Send private message
Amit Manas Dubey
Currently Banned

New User


Joined: 15 Dec 2006
Posts: 22
Location: Mumbai

PostPosted: Mon Jan 29, 2007 5:55 pm    Post subject:
Reply with quote

Hi

Actually, I am interested in knowing if this can be done without commenting the Step1 and Step3.

One way is to use RESTART parm from Step 2 and then use COND(0,LE) which will skip the Step 3 also, if Step 2 executes with a RC=0.

But what I want is that whatever happens to Step 2, Step 1 and Step 3 are not executed.

Hope I am clear on this.

Thanks
Amit.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Mon Jan 29, 2007 6:11 pm    Post subject:
Reply with quote

I use COND=(1111,NE) to bypass steps (if RC not= 1111, which should be all prev steps).

Since 1111 is not a standard RC, it stands out visually as a special check.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 30, 2007 4:51 am    Post subject:
Reply with quote

Hi Amit,

Code "RESTART=STEP2,COND=(0,LE)" in the JOB card along w/any other params you need.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Jan 30, 2007 11:02 am    Post subject:
Reply with quote

Hi Amit,

You can use IEBEDIT for this

Code:
// JOB . . .
//STEP1 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=dataset that contain jcl,DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=STEP2
/*
Back to top
View user's profile Send private message
pankaj_kulkarni111

New User


Joined: 17 Aug 2006
Posts: 13
Location: Pune

PostPosted: Mon Apr 02, 2007 4:02 pm    Post subject:
Reply with quote

Amit,

There are FOUR methods to do this.

1. Use IEBEDIT which is well expalined by few people here.
2. Just comment out all the remaining steps in the pgm.
3. Just mark NULL statement (//) after the step 2 which will end the program.
4. See below pgm
//T91IPPUB JOB ('pppp17',22),'pop-GROUP', CLASS=K,MSGCLASS=T,NOTIFY=&userid
RESTART=STEP2,COND=(0,LE)
.
.
//step1 exec pgm=pgm1
//step2 exec pgm=pgm2,COND=(4095,GE)
//step3 exec pgm=pgm3

I believe there may be another method to do this, just we need to check!

Pankaj
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Mon Apr 02, 2007 4:38 pm    Post subject: Re: Executing only one step in a Job
Reply with quote

Please search the forum before you post..

The method to execute STEP2 in a JCL containing 3 steps as Step1,Step2 and Step3.

Please use the COND parameter as COND=ONLY in the steps that you don't want to execute.In this case code it in Steps 1 and 3.

You will get the desired result.. icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 02, 2007 4:41 pm    Post subject:
Reply with quote

Using COND=ONLY is not such a good idea, what happens if STEP2 abends ???
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Mon Apr 02, 2007 4:56 pm    Post subject: Re: Executing only one step in a Job
Reply with quote

Amit wrote

Quote:
But what I want is that whatever happens to Step 2, Step 1 and Step 3 are not executed.

Hope I am clear on this.


So His requirement is Step 2 can come out with any type of result but No Step 3 execution...

I am not sure what you mean by IF Step 2 abends?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 02, 2007 5:30 pm    Post subject:
Reply with quote

COND=ONLY states that this step will ONLY process if a previous step abends. So if his STEP2 abends Sx37 then STEP3 WILL be processed.
Back to top
View user's profile Send private message
pankaj_kulkarni111

New User


Joined: 17 Aug 2006
Posts: 13
Location: Pune

PostPosted: Mon Apr 02, 2007 5:48 pm    Post subject:
Reply with quote

muthuvel, i m sorry but pls revise the jcl once..
icon_wink.gif
Pankaj
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Mon Apr 02, 2007 7:20 pm    Post subject: Re: Executing only one step in a Job
Reply with quote

Thanks for the correction.. icon_super.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 02, 2007 7:28 pm    Post subject:
Reply with quote

No problems.

Love the image http://ibmmainframes.com/images/smiles/36_2_35.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us