View previous topic :: View next topic
|
Author |
Message |
kalais
New User
Joined: 18 Apr 2006 Posts: 22
|
|
|
|
hi
In REXX programming
how i can check wether a data set(PS/PDS) is existing or not. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
DwChilders
New User
Joined: 14 Apr 2006 Posts: 7
|
|
|
|
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 |
|
|
subramaniabharathi
New User
Joined: 09 Mar 2006 Posts: 9
|
|
|
|
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 |
|
|
punith007 Warnings : 1 New User
Joined: 16 May 2006 Posts: 11 Location: INDIA
|
|
|
|
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 |
|
|
|