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
 
Execute from a particular job step using COND.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
murmohk1

Senior Member


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

PostPosted: Tue Mar 20, 2007 9:43 am    Post subject: Execute from a particular job step using COND.
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: Chennai

PostPosted: Tue Mar 20, 2007 11:42 am    Post subject: Re: Execute from a particular job step using COND.
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 12:28 pm    Post subject:
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: Chennai

PostPosted: Tue Mar 20, 2007 1:53 pm    Post subject: Re: Execute from a particular job step using COND.
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:04 pm    Post subject:
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: Chennai

PostPosted: Tue Mar 20, 2007 2:05 pm    Post subject: Re: Execute from a particular job step using COND.
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:22 pm    Post subject:
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    Post subject: Re: Execute from a particular job step using COND.
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    Post subject:
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: 8201
Location: East Dubuque, Illinois, USA

PostPosted: Tue Nov 04, 2008 6:25 pm    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Tue Nov 04, 2008 10:48 pm    Post subject: Reply to: Execute from a particular job step using COND.
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    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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 6 Fri Sep 22, 2017 7:08 am

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