Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us