View previous topic :: View next topic
|
Author |
Message |
ravi.bollineni
New User
Joined: 28 Jun 2006 Posts: 8
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Well, ask yourself, since you're in a TSO environment, how would you determine if a dataset exists in TSO? |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
|