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
 
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: 4650
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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

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