Hi Nancy - I don't
know the answer to either of your questions, but I can speculate for you. :-)
When you say "allocation or OPEN exit", are you speaking of the subsystem calls (39 and 16, I think) or of DFSMS-type exits? Allocation would only be a subsystem call, I think, but then you mention restrictions on using Dynalloc from "User exits for OPEN/CLOSE/EOV". I can't see there'd be a restriction on doing Dynalloc from the subsystem calls, but of course those calls are being made in the caller's environment, and who know what that is in the case of allocation... I guess you could experiment to see if you have an enqueue on SYSZTIOT when you get control.
Another approach is of course to use batch allocation for your dataset, and then inform your subsystem of the allocation with a parameter on the DD that has the SUBSYS= - something like
//REALFILE DD DSN=name,DISP=...
//MYFILE DSN=filename,SUBSYS=(ssid,"REALFILE","parm2") (or even use the DDNAME as the DSN, which is really just another parm in this context)
I have no idea why Dynalloc would be ignoring your DALDDNAM. Presumably you can just use the SYSnnnnn, but maybe it's a warning that you are going down a not well explored path.
In a way I'm surprised that you have got this far given the lack of IBM doc on the subsystem interface. This general topic has been discussed at length on the IBM-MAIN list over many years, and it will probably pay you well to check the archives there, and/or ask your question there as well.
"For IBM-MAIN subscribe / signoff / archive access instructions, send email to
listserv@listserv.ua.edu with the message: INFO IBM-MAIN"
Regards... Tony H.
------------------------------
Tony Harminc
------------------------------
Original Message:
Sent: Tue July 26, 2022 12:52 PM
From: Nancy Kilroy
Subject: Dynamically allocating a data set that is also specified in JCL with a SUBSYS parameter
Hello,
We are writing a subsystem to handle some special processing for a dataset that we allocate using a SUBSYS keyword. For example,
//MYFILE DSN=filename,SUBSYS=(ssid,"parm1","parm2")
When allocation is complete, we see the MYFILE DD in the TIOT, but listed as a 'JES2' file. This is not surprising, as all the reading I've done indicates that the filename is not allocated as if it were a 'regular' MVS file but as a subsystem file. However, since we need to do some IO to this file, we do need to allocate it at some point as a non-subsystem file as well.
I have issued SVC 99 to allocate the file as a regular file from the subsystem allocation subsystem exit that is called when the MYFILE DD is allocated. This worked, although it was not allocated with the DDname I assigned in the DALDDNAM text unit -- instead it was allocated with a SYSnnnnn DD name. Additionally, I also tried allocating it from the subsystem OPEN exit that is called when the MYFILE subystem file is opened by a test program. This worked as well, although since the TIOT was already held, we had to reissue the SVC 99 with the S99TIONQ flag.
My questions are:
(1) While it appears that I can allocate the file from either the allocation or OPEN exit, I am not sure that this is the proper thing to do. The SVC 99 documentation (in "When to avoid using Dynamic Allocation" in "z/OS MVS Programming: Authorized Assembler Services Guide" lists restrictions on using SVC 99 including
- User exits for OPEN/CLOSE/EOV, or for any other routines that enqueue on SYSZTIOT.
Does this mean we should NOT code the SVC 99 in the subsystem allocation or open exits?
(2) Why would the file be allocated under a SYSnnnnn DDNAME, if I specify a different one in the DALDDNAM text unit? This seems to occur when I allocate the data set in the allocate or open subsystem exits.
Thank you
------------------------------
Nancy Kilroy
------------------------------