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

Checking existence of file in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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 All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
Search our Forums:


Back to Top