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
 

 

Checking existence of file in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kris_chennai

New User


Joined: 19 Dec 2005
Posts: 7
Location: Chennai

PostPosted: Fri Dec 23, 2005 4:40 pm    Post subject: Checking existence of file in JCL
Reply with quote

Hi,

Could you help me? the requirement is

// SET DATASET=1205
// SET PDATASET=1105



//I1MW20FL DD DSN=TST.CTS.TEST1.M&DATASET

if for example data set M1205 is available we need to take the data set processing else we need to take previous month processing (PDATASET)

How do I check the data set is available for processing @ run time..
Back to top
View user's profile Send private message

MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Dec 23, 2005 6:56 pm    Post subject:
Reply with quote

You can do this using a constructed jcl(that can be also a proc to reduce the maintenance) that exec different blocks:
i.e.
Code:
//* NEW BLOCK (GEN)                             
//STEP010I EXEC PGM=IDCAMS                       
//SYSPRINT DD SYSOUT=*                           
//SYSIN    DD *                                 
  LISTCAT ENTRIES(MY GEN FILE) ALL               
//* MY PROGRAM WITH MY INPUT FILE (GEN)
//STEP010P EXEC PGM=IEFBR14,COND=(0,NE,STEP010I)
//* NEW BLOCK (FEB)                             
//STEP020I EXEC PGM=IDCAMS                       
//SYSPRINT DD SYSOUT=*                           
//SYSIN    DD *                                 
  LISTCAT ENTRIES(MY FEB FILE) ALL           
//* MY PROGRAM WITH MY INPUT FILE (FEB)   
//STEP020P EXEC PGM=IEFBR14,COND=(0,NE,STEP020I)


or you can do this using a single Rexx program to do all in a step.
Rember that the SET statement will work only in JCL statement and not in instream parameters.

I hope in this help.

P.S.= if you search in this forum you will find many other solution.
Back to top
View user's profile Send private message
kris_chennai

New User


Joined: 19 Dec 2005
Posts: 7
Location: Chennai

PostPosted: Fri Dec 23, 2005 8:31 pm    Post subject:
Reply with quote

Hi LISTCAST entry should be passed from JCL. How can I do that. The entry should not be static..
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Dec 23, 2005 8:52 pm    Post subject:
Reply with quote

If you submit the jcl above from your userid you will get some error because SET statement allow substitution only in JCL statement and not in instream parameter or DD DATA.
The only way to change the value before the submit is from a scheduler or a trick.

I hope in this help.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 24, 2005 10:49 pm    Post subject:
Reply with quote

Hi Kris,

One way to accomplish this is to use the INTRDR. Do a search here. There is a lot of info available.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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