View previous topic :: View next topic
|
Author |
Message |
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|