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
 
Conditional execution of a step in jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Conditional execution of a step in jcl
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: 8593
Location: Back in jolly old England

PostPosted: Sun May 16, 2010 5:17 pm    Post subject:
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: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Sun May 16, 2010 5:29 pm    Post subject:
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

Site Director


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

PostPosted: Sun May 16, 2010 9:13 pm    Post subject:
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    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 it is possible output a SET value fro... Martylin JCL & VSAM 4 Fri Sep 22, 2017 7:08 am
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm

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