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
 

 

Check whether Dataset is existed or not

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
ravi.bollineni

New User


Joined: 28 Jun 2006
Posts: 8

PostPosted: Thu Aug 10, 2006 7:50 pm    Post subject: Check whether Dataset is existed or not
Reply with quote

Hi All,

I am executing the REXX program under TSO environment. And my program is writting data into one Physical Sequential(PS) file.

I choose the Parameter as "NEW" While creating PS. while executing my program second time with out deleting the Physical Sequential(PS) file, i am getting the following description(it's not an error) even though i perform the code for deleting the existing dataset(PS).

Following is the error description:
DATA SET IND9437.FINL.REPORT NOT ALLOCATED+
IGD17101I DATA SET IND9437.FINL.REPORT
NOT DEFINED BECAUSE DUPLICATE NAME EXISTS IN CATALOG
RETURN CODE IS 8 REASON CODE IS 38 IGG0CLEH
ENTRY (A) IND9437.FINL.REPORT DELETED
OUTDATASET- IND9437.FINL.REPORT SUCCESSFULLY ALLOCATED.

-----------------*****************************---------------------

THE DETAILED & SUMMARY REPORTS ARE IN THE DATASET: IND9437.FINL.REPORT

-----------------*****************************---------------------

I think it is trying to crerate a dataset already existing one. That's the reason i am getting the above description.

Following is my code:

OUTDSNAME = STRIP(USERID())||".FINL.REPORT"

"ALLOC F(DDOUT) DA('"||OUTDSNAME||"') NEW " ||,
" RECFM(F) DSORG(PS) LRECL(80)"


IF RC > 0 THEN
DO
"DELETE '"||OUTDSNAME||"' PURGE"
"ALLOC F(DDOUT) DA('"||OUTDSNAME||"') NEW " ||,
" RECFM(F) DSORG(PS) LRECL(80)"

IF RC > 0 THEN
DO
SAY "ERROR!!! ALLOCATING THE OUTPUT DATASET."
EXIT
END
ELSE
SAY 'OUTDATASET- '||OUTDSNAME|| ' SUCCESSFULLY ALLOCATED.'
END

"EXECIO * DISKW DDOUT (STEM OUT. FINIS"

IF RC = 0 THEN
DO
SAY
SAY '-----------------*****************************--------------
SAY
SAY'THE DETAILED & SUMMARY REPORTS ARE IN THE DATASET: '|| OUTDSNAME
SAY
SAY '-----------------*****************************--------------
END;
"FREE F(DDOUT)"
EXIT


Can i check whether the dataset is existed or not in my code. If it is possible can you share some sample code. I can delete the Dataset manually and execute the REXX program second time it is not showing the above description. I don't want manually deletion and i want to do thru code.

Could you please help me out in this regard.

Always Thanking you,
Ravi.
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: Thu Aug 10, 2006 7:56 pm    Post subject: Re: Check whether Dataset is existed or not
Reply with quote

Well, ask yourself, since you're in a TSO environment, how would you determine if a dataset exists in TSO?
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Aug 10, 2006 7:58 pm    Post subject: Re: Check whether Dataset is existed or not
Reply with quote

Why not have the DELETE always present prior to the ALLOC. Don't ALLOC, check the RC, then DELETE and ALLOC. Just DELETE and ALLOC.
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
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