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
 

 

Check for the existence of 4 files in a JCL step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Thu May 03, 2007 7:55 pm    Post subject: Check for the existence of 4 files in a JCL step
Reply with quote

In my job, first I need to check if 4 files (files are already created in different jobs) of length 80,FB are present in a step. If atleast one of the file is present, then I need to execute Step2 otherwise execute Step3.

Pls let me know if I need to provide more information.

Thanks
Aneeta
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: Thu May 03, 2007 8:32 pm    Post subject:
Reply with quote

Hello,

Please post the jcl you have so far.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sun May 06, 2007 11:01 am    Post subject:
Reply with quote

Sound like a simple job for REXX with LISTDSI and EXIT RC.

O.
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 06, 2007 1:33 pm    Post subject:
Reply with quote

Quote:
If atleast one of the file is present, then I need to execute Step2 otherwise execute Step3.

How do you intent to allocate the file(s). Obviously the JCL will need to change to reflect the files that are there and those that are not.

As you can not dynamically change the JCL once it has been interpretted by JES, you may find yourself getting a few more JCL errors than you want to.

Quote:
Sound like a simple job for REXX with LISTDSI and EXIT RC.

Which given the circumstances is about the only viable option.

To add to this, it might be worth performing a merge of those inputs that do exist in the REXX so that you will have a known named file being created for later processing.
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 06, 2007 10:07 pm    Post subject:
Reply with quote

Hello,

Another option would be to use a common gdg. All ot the input datasets would be created as a +1 of the common gdg in the 4 creating jobs. Step2 would read all of the cataloged versions and process according to whether it read the first record or reached AT END on the first read.

To start this process and each time the entire gdg collection is used, all cataloged versions would be deleted and a new 1st version would be created with a valid EOF (so when read, the program would detect AT END on the first read).

If step2 reached AT END on the first read, there is no input. There is no need for checking if files exist or any other jcl concerns.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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