Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To Check Existence Of PDS in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
bigcoolbudy

New User


Joined: 12 Jun 2006
Posts: 12

PostPosted: Tue Jul 18, 2006 12:10 am    Post subject: To Check Existence Of PDS in JCL
Reply with quote

Hi,

I have to check the existence of a PDS fisrt in the JCL, if it exist then only need to process otherwise exit with sucess from the job with message "File Not found".

Can anyone let me help, how i can handle this.

Thanks
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Jul 18, 2006 3:01 am    Post subject: Re: To Check Existence Of PDS in JCL
Reply with quote

You could go with either:

1. Use the TSO LISTDS command.

2. Use a CLIST with the &SYSDSN command or the LISTDSI command.

3. Use a REXX exec with SYSDSN command or the LISTDSI command.

4. Use a program calling ISPF Library Management (LM) services.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jul 18, 2006 3:24 am    Post subject: Re: To Check Existence Of PDS in JCL
Reply with quote

Or, prior to youir program starting, you can test for the existance of the file with IDCAMS

Code:

//JS00100  EXEC PGM=IDCAMS               
//SYSPRINT DD DUMMY                       
//SYSIN DD *                             
  PRINT IDS('YOUR.PDS.TESTFILE') COUNT(1)


IDCAMS will return RC=0 if the file exists, RC=12 if not. You can then selectively execute steps depending on the RC from IDCAMS
Back to top
View user's profile Send private message
bigcoolbudy

New User


Joined: 12 Jun 2006
Posts: 12

PostPosted: Tue Jul 18, 2006 5:47 am    Post subject: Re: To Check Existence Of PDS in JCL
Reply with quote

Thanks David for thereply. I'll code accordingly.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us