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

Possible Condition Code in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chattogokul

New User


Joined: 03 May 2005
Posts: 16

PostPosted: Tue Mar 21, 2006 12:26 pm
Reply with quote

Hi all,

Let's say there are 2 steps in my JCL.

First Step is for backing a file up to some other destination PS.
Second Step is for deleting the source file after successful backing up of the file.

The Condition here is STEP2 should not execute unless and untill the successful execution of preceding step ie., STEP1.

Can anybody please tell me what are the possible condition can we code.

Plz clarify this..

Thanking You.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 12:42 pm
Reply with quote

Code:
//STEP1         EXEC PGM=IEBGENER        >> Dataset Back-up
//*
//*
//STEP2         EXEC PGM=<<FILE DELETING>>,COND=(0,NE,STEP1)
//*
//*


Regards,
Priyesh.
Back to top
View user's profile Send private message
chattogokul

New User


Joined: 03 May 2005
Posts: 16

PostPosted: Tue Mar 21, 2006 1:04 pm
Reply with quote

Hi Priyesh,

Thank You,
Back to top
View user's profile Send private message
martijn

New User


Joined: 09 Mar 2006
Posts: 14
Location: The Netherlands

PostPosted: Tue Mar 21, 2006 6:48 pm
Reply with quote

hi,

In addition, can I just add:-

- Instead of (0,NE,<stepname>), you can also code (0,NE), in which case every previous step is checked.
- If the step you want to check runs a PROC, you have to code:
(0,NE,<stepname>.<procstepname>).

- You can also code COND=(0,NE) on the job-card! in which case every step will check all previous steps!
Back to top
View user's profile Send private message
pspreddy

New User


Joined: 14 Mar 2006
Posts: 24
Location: Chicago

PostPosted: Wed Mar 22, 2006 1:06 am
Reply with quote

Also you can direct the job to abend if the backup is not successful and if you do not want a return code of 0 unless on successful backup.

Ex Code below

//CCHK1000 EXEC PGM=CHECKSTP,
// COND=(0,EQ,FRSJS030.FRS55010),
// PARM='ABND=4000,MSG=*NON-ZERO RETURN CODE IN PRIOR STEP*'
//CA11NR DD DUMMY
//STEPLIB DD DSN=ISO.LINKLIB,DISP=SHR

or

// IF RC > 0 THEN
//CCHK1000 EXEC PGM=CHECKSTP,
// PARM='ABND=4000,MSG=*NON-ZERO COND CODE IN PRIOR STEP*'
//CA11NR DD DUMMY
//STEPLIB DD DSN=ISO.LINKLIB,DISP=SHR
// ENDIF
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Mar 22, 2006 6:59 am
Reply with quote

Any reason why you don't handle both tasks in a single job step (i.e. an IDCAMS REPRO/DELETE).
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top