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

Conditional execution of a step in jcl


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

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Sun May 16, 2010 5:10 pm
Reply with quote

Hi,

Can someone help me on how to execute a step in a JCL on a conditional basis..
Condition should be if the flat file exists, then execute the step. That is only if the flat file is present, then the step should be executed. I know there is an option called "LISTCAT". But my file uses symbolic parameters.
It would be of great help if someone posts that conditional part alone.

Thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun May 16, 2010 5:17 pm
Reply with quote

The JCL referemce manual has everything that you will need to know to execute steps conditionally.

The IBM Manuals button at the top of every page is your first step to learning.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sun May 16, 2010 5:29 pm
Reply with quote

JCL conditionals cannot be used to determine file existence. As stated, your request cannot be implemented. You can generate a LISTCAT, parse the output with a utility or a program YOU write, then submit a second JCL depending upon whether or not the file exists. However, you cannot do all this in a single job -- you MUST submit a second job that can include or exclude the step you don't want to run if the file doesn't exist.

Learn to use the search function. This topic has been discussed many times on this forum and if you searched the forum before posting you would have answered your question already.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 16, 2010 9:13 pm
Reply with quote

Hello,

Another possibility would be to make sure the file always exists - even if empty. . . .

The process would of course haven to properly handle an input file with no records - which is rather trivial.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Conditional EATTR in MFS ? IMS DB/DC 0
Search our Forums:

Back to Top