Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, 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
Location: INDIA

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us