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

Checking existence of a dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalais

New User


Joined: 18 Apr 2006
Posts: 22

PostPosted: Wed Apr 19, 2006 6:36 pm
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
superk

Global Moderator


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

PostPosted: Wed Apr 19, 2006 11:54 pm
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
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
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
Location: INDIA

PostPosted: Wed Jul 05, 2006 7:57 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top