(Cross-posting to IBM-MAIN and MVS-OE)
There's a potential RCF here, but I'd like other opinions.
In:z/OS Version 2 Release 4
MVS Programming: Authorized Assembler Services Guide
IBM SA23-1371-40
z/OS UNIX file options - Key = '8018'
DALPOPT specifies the file options for the z/OS UNIX file.
You can code DALPOPT only when you also code the pathname
(DALPATH) key.
If
• You specify either
– The hex integers representing OCREAT alone
or
– The hex integers representing both OCREAT and OEXCL
on the DALPOPT key,
I'm visualizing the Venn diagram. The condition is met
either for OCREAT without OEXCL or OCREAT with OEXCL.
OEXCL doesn't matter and its mention here is a distraction.
And if
• The file does not exist,
Then MVS performs an open() function.
This is the exception that proves the rule. May I assume
that if the file does exist, DYNALLOC performs no open()
function?
The options from DALPOPT, the pathname from the DALPATH key,
and the options DALPMDE (if specified) are used in the open().
MVS uses the close() function to close the file before the
application program receives control.
The following appears to have been written long ago, before there
was access method support for UNIX files. Nowadays, it's more
likely that "the application" performs the operations indirectly,
invoking BSAM/QSAM via the OPEN macro, The description should
be expanded to clarify this.
For status group options other than OCREAT and OEXCL, the
description in this information assumes that the application
passes the values to the open() function without modification.
What does BSAM/QSAM OPEN do with OCREAT and OEXCL? Does it mask
then out, not passing them to open()? If so, and if as above no
open() is performed by allocation for an existing file, the POSIX
specification:
https://pubs.opengroup.org/onlinepubs/009695399/functions/open.html
O_EXCL
If O_CREAT and O_EXCL are set, open() shall fail if the file exists.
is violated because OPEN invokes open() without OCREAT or
OEXCL and that open() succeeds.
That is, this application uses dynamic allocation information
retrieval (the DYNALLOC macro) to retrieve the value specified
for DALPOPT and passes the value to the open() function. The
application program can ignore or modify the information
specified in the JCL.
"JCL" should be "DYNALLOC". Likewise, two uses of "MVS" above
should more precisely be "DYNALLOC".
Much of the information here is duplicated in the JCL Reference
for DD:PATHOPTS. Any changes here might need to be reflected
in the JCL Ref.
Thanks,
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN