MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Check if File exist or not out of 250 files concatenated

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
dhansr
Beginner


Joined: 26 May 2016
Posts: 14
Topics: 6

PostPosted: Thu Dec 08, 2016 12:51 pm    Post subject: Check if File exist or not out of 250 files concatenated Reply with quote

Hi,

I have a job where 250 files are concatenated for INPUT dd name (for example I have 15 files only), before running the job I need to check if any of the 250 files does not exist which need to be removed before job run to avoid job abend. Below is the JCL, this need to be handled in batch mode so that before job run the check happens automatically and inform user the files which does not exist. or is there a way where job can be completed successfully even if some of the file does not exist out of the concatenated list of files.

Please advise,

Code:

//STEP010  EXEC PGM=PROGRAM1
//INPUT    DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.1,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.2,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.3,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.4,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.5,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.6,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.7,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.8,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.9,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.10,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.11,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.12,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.13,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.14,DISP=SHR
//         DD   DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.15,DISP=SHR
//OUTPUT   DD   DSN=TEST.IP.AUTO.FILE.D1206,DISP=SHR
//SYSOUT   DD   SYSOUT=*
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Dec 08, 2016 1:42 pm    Post subject: Reply with quote

dhansr,

You have couple of options

1. If your shop has a JCL checker software you can run it in batch and extract the messages for missing datasets.

2. Alternatively you can code an IEFBR14 step with DISP=(MOD,KEEP,DELETE) for all your files and even if the file did not exist it will be present for the actual program.

Code:

//STEP001  EXEC PGM=IEFBR14                                       
//FILE001  DD DSN=TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.1,           
//            DISP=(MOD,KEEP,DELETE),SPACE=(TRK,(1,0),RLSE),     
//            DCB=(LRECL=A,RECFM=BB)                             


3. You can have listcat of the files based on HLQ and verify it against your list and Dummy them out.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dhansr
Beginner


Joined: 26 May 2016
Posts: 14
Topics: 6

PostPosted: Thu Dec 08, 2016 3:13 pm    Post subject: Reply with quote

Thank You ! Kolusu.

Option 3 is suitable for my requirement and I am using like below it works fine as I am able to search through the listcat output file through a program to find missing files.
Code:

//STEP010  EXEC PGM=IDCAMS,REGION=0M
//SYSPRINT DD DSN=TEST.LISTCAT.SYSPRINT.OUTPUT,DISP=SHR
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *,SYMBOLS=EXECSYS
  LISTCAT ENT('TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.1')
  LISTCAT ENT('TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.2')
  LISTCAT ENT('TEST.IP.ALLRGN.OUTFIL.DAY01.FILE14.3')
/*
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Fri Dec 09, 2016 10:48 am    Post subject: Reply with quote

dhansr wrote:
Thank You ! Kolusu.

Option 3 is suitable for my requirement and I am using like below it works fine as I am able to search through the listcat output file through a program to find missing files.


You can add LASTCC check after every listcat and write the file name to a dataset and then dummy out the file in there
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group