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

Execute from a particular job step using COND.


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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 9:43 am
Reply with quote

Could it be possible to start the job execution from a particular step using COND parameter (should not use restart)?

My answer was NOT POSSIBLE. Please let me know, if Im correct or made a mistake.

Thanks all for your inputs in advance.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Tue Mar 20, 2007 11:42 am
Reply with quote

Murmokh,
In the job card give the steps not to be executed as COND=ONLY.
For example ,if the job has 3 steps R1,R2,R3.Let's assume you want to execute the 3rd step alone and skip the first two steps.
Then code it as COND.R1=ONLY,COND.R2=ONLY
where R1 and R2 are step names.
By doing this you skip the first two steps and execution will be for R3 only.

Hope you are clear....
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 12:28 pm
Reply with quote

Muthu,

I had tried executing a job with 3 steps (all are iefbr14 steps). Got the JCL error. Pasted the spool message (JESJCLIN)
below for your reference -


Code:


//CONDDDD JOB (TEST),'PD2ZD',NOTIFY=&SYSUID,TIME=(,5),
//          COND.STEP1=ONLY,COND.STEP3=ONLY
************** NON-VALID JOB      STMT - KEYWORD LENGTH NOT VALID ******
//* $ACFJ219 ACF2 ACTIVE MVSD
//*
//*
//STEP1  EXEC PGM=IEFBR14
//IN1   DD DSN=&&SYSUID..MURALI.UTILS1,DISP=(MOD,DELETE,DELETE),
//         SPACE=(TRK,0)
//*
//STEP2  EXEC PGM=IEFBR14
//IN2   DD DSN=&&SYSUID..MURALI.UTILS2,DISP=(MOD,DELETE,DELETE),
//         SPACE=(TRK,0)
//*
//STEP3  EXEC PGM=IEFBR14
//IN3   DD DSN=&&SYSUID..MURALI.UTILS3,DISP=(MOD,DELETE,DELETE),
//         SPACE=(TRK,0)
$HASP106 JOB DELETED BY JES2 OR CANCELLED BY OPERATOR BEFORE EXECUTION
------ JES2 JOB STATISTICS ------
           17 CARDS READ
            7 SYSOUT PRINT RECORDS
            0 SYSOUT PUNCH RECORDS
            0 SYSOUT SPOOL KBYTES
         0.00 MINUTES EXECUTION TIME




My intention was to execute step2 alone. I assume the JCL error is because of COND condition given in the job statement.

Could be please share few more inputs in this regard.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Tue Mar 20, 2007 1:53 pm
Reply with quote

I have done it for cataloged procedures.I am testing for instream procedure.

Any way myguess, don't code it in job statement.

Code it seperately between jobcard and step1.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:04 pm
Reply with quote

Muthu,

Quote:
Code it seperately between jobcard and step1.


Could you provide an example for this?
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Tue Mar 20, 2007 2:05 pm
Reply with quote

Hi here's the answer,
COND=ONLY should be given in the particular step which you don't want to execute.
For example,If Step 1 is to be bypassed
Code:
STEP1 EXEC PGM=IEFBR14,COND=ONLY

for step2 it is
Code:
STEP2 EXEC PGM=IEFBR14,COND=ONLY


This will help you...
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:22 pm
Reply with quote

Thanks Muthu. It worked fine.
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Tue Nov 04, 2008 5:56 pm
Reply with quote

muthuvel wrote:
Hi here's the answer,
COND=ONLY should be given in the particular step which you don't want to execute.
For example,If Step 1 is to be bypassed
Code:
STEP1 EXEC PGM=IEFBR14,COND=ONLY

for step2 it is
Code:
STEP2 EXEC PGM=IEFBR14,COND=ONLY


This will help you...


Suppose I have 3 IEFBR14 steps in my JOb, Step1,2 and 3 and I want to run only STEP1 and STEP3, and if I code

STEP1 EXEC PGM=IEFBR14,COND=ONLY
.
.
.
STEP2 EXEC PGM=IEFBR14
.
.
STEP3 EXEC PGM=IEFBR14,COND=ONLY

STEP1 will definately run,because there are no previous return codes to check hence the first step runs. STEP2 will run of course, no issues. and then STEP3 when it checks the return code, suppose STEP2 has abended... then that would mean that STEP3 WILL ALSO RUN!!?

Correct me If I am wrong.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Nov 04, 2008 6:22 pm
Reply with quote

STEP1 will not run, even if it is first step when you use COND=ONLY.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Nov 04, 2008 6:25 pm
Reply with quote

From the JCL Language Reference:
Quote:
The system evaluates a COND parameter on the first EXEC statement in a job as false. However, you can use an IF statement before the first EXEC statement in a job to bypass the step.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Nov 04, 2008 6:41 pm
Reply with quote

True Robert. But I concluded my statement after thorough testing only.
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Tue Nov 04, 2008 10:27 pm
Reply with quote

Oops.. Sorry
What I meant to write was "STEP1 will DEFINATELY NOT RUN"....

Sorry for the typo.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 04, 2008 10:48 pm
Reply with quote

I do not understand why interviewers keep asking such a stupid question...

in any decently managed operations room, people are not allowed to
submit changed on the fly jobs....


the proper steps are...
1 setup
2 run
-- in case of malfunctions
-- recovery/reset
-- repeat step 2
3 post process

the production jobs should never be changed or run partially
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
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 Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top