Page 1 of 2

Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 10:49 pm
by mvmanish
Hi,


I am running rexx to change few parameters in a JCL. Once Rexx completes execution I am ending with Contention issue for that particular PDS. To overcome this I have to close the LPAR every time I execute the rexx. Below is the code which I am using to free the PDS

"ALLOC DA('"MEMBER"') F(MDDOUT1) OLD REU"
"EXECIO * DISKW MDDOUT1 (STEM RECO. FINIS)"
DROP RECO.
IF RC = 0 THEN DO
"FREE F(MDDOUT1)"
END
ELSE DO
SAY "ERROR WHILE WRITING "MDDOUT1" RC = " RC
SAY "TERMINATING..."
"FREE F(MDDOUT1)"
END

Re: Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 10:52 pm
by Pedro
Show us a trace.

Re: Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 10:55 pm
by Pedro
Use TSO ISRDDN to see your allocations. Perhaps you have the same data set allocated by a different DD name.

Re: Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 11:03 pm
by Pedro
I predict that your EXECIO does not work correctly for some reason and you so you still have the file open and the FREE will not free open files.

Re: Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 11:09 pm
by mvmanish
Hi Pedro,

Thanks for your reply.... Below is the trace part of Rexx. Also I can see PDS is allocated for 2 DD names

------------------------------------------------
242 *-* "ALLOC DA('"MEMBER"') F(MDDOUT1) OLD REU"
>>> "ALLOC DA('TEST.REXX.PDS(MEMNAME)') F(MDDOUT1
) OLD REU"
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++


243 *-* "EXECIO * DISKW MDDOUT1 (STEM RECO. FINIS)"
>>> "EXECIO * DISKW MDDOUT1 (STEM RECO. FINIS)"

244 *-* DROP RECO.

245 *-* IF RC = 0
>>> "1"

*-* THEN
*-* DO

246 *-* "FREE F(MDDOUT1)"
>>> "FREE F(MDDOUT1)"

247 *-* END
253 *-* REPT = REPT +1
>>> "2"

254 *-* END
143 *-* DO until REPT > CNUM
>>> "1"
255 *-* RETURN
***

Re: Contention for PDS after executing Rexx

PostPosted: Fri Feb 03, 2017 11:11 pm
by mvmanish
Pedro wrote:I predict that your EXECIO does not work correctly for some reason and you so you still have the file open and the FREE will not free open files.




If I execute the same rexx for some other PDS. it is working fine.

Re: Contention for PDS after executing Rexx

PostPosted: Sat Feb 04, 2017 1:02 am
by prino
mvmanish wrote:To overcome this I have to close the LPAR every time I execute the rexx.
(Emphasis added)

Sheesh... they let a person like you close an LPAR and and re-IPL it because you cannot free a dataset?

This is incompetence taken to a new level, even on a beginners forum...

Re: Contention for PDS after executing Rexx

PostPosted: Sat Feb 04, 2017 1:19 am
by mvmanish
prino wrote:
mvmanish wrote:To overcome this I have to close the LPAR every time I execute the rexx.
(Emphasis added)

Sheesh... they let a person like you close an LPAR and and re-IPL it because you cannot free a dataset?

This is incompetence taken to a new level, even on a beginners forum...



Okay.. then if you have a solution for that... provide it... as I stated my problem clearly that the rexx is not working only for 1 particular PDS.. instead of closing the LPAR do I need to put that in contention :x or do you have any better idea..

Re: Contention for PDS after executing Rexx

PostPosted: Sat Feb 04, 2017 1:33 am
by enrico-sorichetti
who else is using that dataset ?

Re: Contention for PDS after executing Rexx

PostPosted: Sat Feb 04, 2017 1:47 am
by Robert Sample
instead of closing the LPAR do I need to put that in contention :x or do you have any better idea..
Log off TSO and log back on.
If you have console access, cancel your TSO user id.

Doing an IPL of the LPAR should be the LAST resort if nothing else works -- NOT a normal operation.