Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: If COND=(0,LE) is specified to the first step of JCL
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Jul 22, 2008 4:44 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 7999
Location: Bellevue, IA

PostPosted: Tue Jul 22, 2008 8:06 pm    Post subject:
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    Post subject:
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    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 how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us