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

If COND=(0,LE) is specified to the first step of JCL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Tue Jul 22, 2008 11:44 am
Reply with quote

Hi All,

I have two questions to ask.

1. If COND=(0,LE) is specified to the first step of JCL?

I answered like " For first step if COND is specified it is always false and first step executes always if no restart"

2. If JCL have 5 steps S1, S2,S3,S4,S5 in the same order.

How to change the execution irder like excute S4 sfter S5?

I answered to run onetime jobs.
Back to top
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Tue Jul 22, 2008 12:54 pm
Reply with quote

Hi Anand,

You have answered correctly as far as i know.

For the first question, condition code can only be used to control the execution of subsequent steps depending on the current step 's completion code.

Here, since the COND parameter is coded in the first step, it will be executed anyway as the condition is false.

For the second question, the only way to run the step S4 after S5 is to move the job step down or execute it in a different job.
Back to top
View user's profile Send private message
Rajesh Sampath

New User


Joined: 18 Jun 2008
Posts: 9
Location: Pune

PostPosted: Tue Jul 22, 2008 4:35 pm
Reply with quote

Hi anand,

For your first question,

COND parameter is not coded in the first step.

For your second question,

Use restart parameter in the job card like this

restart=include(step1, step2, step3, step5, step4)

Correct me if im wrong.

With Regards

Rajesh Sampath
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jul 22, 2008 4:44 pm
Reply with quote

Hi,
Quote:
Use restart parameter in the job card like this

restart=include(step1, step2, step3, step5, step4)


Which JCL manual did the above come from ?


Gerry
Back to top
View user's profile Send private message
Rajesh Sampath

New User


Joined: 18 Jun 2008
Posts: 9
Location: Pune

PostPosted: Tue Jul 22, 2008 5:24 pm
Reply with quote

Really sorry,

Im wrong.

We solve the problem by using IEBEDIT utility with EDIT TYPE = include, Stepname = (Step1, Step2, Step3, Step5, Step4) in SYSIN statement



With Regards

Rajesh Sampath
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jul 22, 2008 5:33 pm
Reply with quote

I hope step5 isn't using output from step 4.
Back to top
View user's profile Send private message
Rajesh Sampath

New User


Joined: 18 Jun 2008
Posts: 9
Location: Pune

PostPosted: Tue Jul 22, 2008 6:05 pm
Reply with quote

No input for step5 from step4.
Back to top
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Tue Jul 22, 2008 7:37 pm
Reply with quote

Rajesh,

I tried using IEBEDIT utility to see if the order of the steps in a job can be changed. It looks like we cannot change the order of the job steps through the INCLUDE type in the EDIT statement, but we can only include or exclude the job steps from one or more jobs.

For example,

I ran the below IEBEDIT step and its input contains a job with 5 steps (R010, R020, R030, R040 & R050 in the same order).

Code

//STEP1 EXEC PGM=IEBEDIT
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSN=INPUT.PDS(MEMBER),DISP=OLD,KEEP)
//SYSUT2 DD DSN=OUTPUT.FILE,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,50,10),RLSE),DCB=RECFM=F,LRECL=80,BLKSIZE=80)
//SYSIN DD *
EDIT TYPE=INCLUDE,STEPNAME=(R010,R020,R030,R050,R040)
/*
//*

Though i have changed the order of job steps in the EDIT statement above, OUTPUT.FILE had the job steps in the same order as it was in the input.

Please correct me if am wrong.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Jul 22, 2008 8:02 pm
Reply with quote

I believe several of the replies to the original poster are not correct. The COND parameter determines whether or not the current step is bypassed or executed based on the result of previous steps or the step named in the COND parameter(s). In other words, if COND=(0,LE) is coded on the 1st step of a job, that step will be bypassed since zero is less than or equal to any previous step. The condition is true in all cases. Since I don't have access to a mainframe, the best way to find out is to test it yourself. It's easy enough to create a test job consisting of a bunch of IEFBR14 job steps. COND evaluations only determine whether the current step is executed. It has no effect on subsequent steps.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jul 22, 2008 8:06 pm
Reply with quote

From the JCL reference manual:
Quote:
16.5.4 Location in the JCL


You can specify the COND parameter on any EXEC statement in the job. However, the system evaluates a COND parameter on the first EXEC statement in a job as false.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Jul 22, 2008 8:10 pm
Reply with quote

I stand corrected on that point. Thanks! icon_redface.gif
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Forcing a step to run (even if abended) JCL & VSAM 8
Search our Forums:

Back to Top