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,

    And if

  • The file does not exist,
Then MVS™ performs an 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.

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. 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.

When you code DALPOPT, # must be 1 and LEN must be 4; PARM must contain one of the following values or an "inclusive OR" result from any combination of the following values:

Table 1. DALPOPT Options
Four-byte Hex Integers JCL Equivalent
X'00000100' OSYNC
X'00000080' OCREAT
X'00000040' OEXCL
X'00000020' ONOCTTY
X'00000010' OTRUNC
X'00000008' OAPPEND
X'00000004' ONONBLOCK
X'00000003' ORDWR
X'00000002' ORDONLY
X'00000001' OWRONLY
Example: To specify a file option of read-only for a z/OS UNIX file option specification, code
KEY    #     LEN   PARM
8018   0001  0004  00000001
Example: To specify a file option of create, if the file does not already exist with the intent to read and write the file, use the "inclusive OR"+: result of OCREATOEXCL and code
KEY    #     LEN   PARM
8018   0001  0004  000000C3