View previous topic :: View next topic
|
Author |
Message |
JOYEETA PAUL Currently Banned New User
Joined: 18 Sep 2008 Posts: 17 Location: bangalore
|
|
|
|
I used a dataset in my rexx prog like -
DSNAME = TEST.TPLASM.CATLIST
ADDRESS TSO
"ALLOC DD(STAC) DA('"DSNAME"') SHR REUSE"
"EXECIO * DISKR STAC (STEM X. OPEN"
In first part of my prog i am calling this subrtn and it is working fine
but in the 2nd part of my prog if i call this part again it is showing error like-' FILE STAC NOT UNALLOCATED, DATA SET IS OPEN "
so i need to unallocate the dataset and then again should use it.but can anybody tell me how to unallocate a DS in same prog after using it. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the correct sequence ( to avoid all troubles ) is
Code: |
ALLOCATE ...
EXECIO ... count ... ( ... - as many times as needed
... for the last I/O operation
EXECIO ... count ... ( ... FINIS - to close the file, if a regular I/O
... or
EXECIO ... 0 ... ( FINIS - to close the file, on a standalone close
FREE ...
|
|
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
Because you have REUSE option, it looks like you just need to CLOSE the file after 1st part is completed. |
|
Back to top |
|
|
JOYEETA PAUL Currently Banned New User
Joined: 18 Sep 2008 Posts: 17 Location: bangalore
|
|
|
|
thank you so much. i just used that "FINIS" there.now it is working perfectly. |
|
Back to top |
|
|
|