Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Checking existence of a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
kalais

New User


Joined: 18 Apr 2006
Posts: 22

PostPosted: Wed Apr 19, 2006 6:36 pm    Post subject: Checking existence of a dataset
Reply with quote

hi

In REXX programming
how i can check wether a data set(PS/PDS) is existing or not.
Back to top
View user's profile Send private message
References
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3314
Location: Charlotte,NC USA

PostPosted: Wed Apr 19, 2006 11:54 pm    Post subject: Re: Checking existence of a dataset
Reply with quote

There is no purely REXX function that does what you want. However, there are some things you can do:

1. If you run your REXX exec outside of a TSO/E address space, you can call the IDCAMS utility with the LISTCAT function, and then query the resulting return-code value.

2. If you run your REXX exec within a TSO/E Address space, you can do one of the following:

A. Use the TSO command LISTDS.
B. Use the TSO command LISTCAT.
C. Use the TSO/E REXX functions SYSDSN or LISTDSI.
Back to top
View user's profile Send private message
DwChilders

New User


Joined: 14 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 9:11 pm    Post subject: Re: Checking existence of a dataset
Reply with quote

I use something like

IF SYSDSN("'ID.T.AAAA.BBBB(WHATTHE)'") <> "OK" then
strMesssage = "Where is the PDS with the WHATTHE member?"
Back to top
View user's profile Send private message
subramaniabharathi

New User


Joined: 09 Mar 2006
Posts: 9

PostPosted: Tue May 02, 2006 9:48 am    Post subject: Re: Checking existence of a dataset
Reply with quote

you can check existense of a dataset using sysdsn command
x=sysdsn("'"ps or pds name"'")
if x is equal to ok then the ps or pds exists
if x is dataset not found then the dataset does not exist
Back to top
View user's profile Send private message
punith007
Warnings : 1

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Wed Jul 05, 2006 7:57 pm    Post subject: Re: Checking existence of a dataset
Reply with quote

I have a requirement. I have to check for the existence of some files in the unix side from mainframe (normally i write files from mainframe to unix). If it is present , i have to delete it. Is that possible by using REXX ?

FYI -- the files will reside in a unix directory as like apps/abcd/aaaXX.txt,
apps/abcd/bbbXX.txt., etc

If possible can you help me with some sample codes ?

Thanks
Punith
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1