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
 

 

Possible Condition Code in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Possible Condition Code in JCL
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: 1452
Location: Chicago, IL

PostPosted: Tue Mar 21, 2006 12:42 pm    Post subject: Re: Possible Condition Code in JCL
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    Post subject: Thanks Alot!!
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    Post subject:
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    Post subject: Re: Possible Condition Code in JCL
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

Moderator Team Head


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

PostPosted: Wed Mar 22, 2006 6:59 am    Post subject: Re: Possible Condition Code in JCL
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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