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: 4648
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm


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