Figure 1 shows the process and the sequence of filling
in the DCB from various sources.
Figure 1. Sources
and Sequence of Operations for Completing the DCB
The following items correspond to the boxed numbers in Figure 1.
- The primary source is your program; that is, the DCB and DCBE
macro or compiler. Usually, you should use only those DCB and DCBE
parameters that are needed to ensure correct processing. The other
parameters can be filled in when your program is to be run.
- A JCL DD statement or a call to dynamic allocation (SVC 99) creates
a job file control block (JFCB). The DD or SVC 99 can supply a data
class (DATACLAS) name. The installation data class ACS routine can
supply or override the data class name. The resulting data class provides
defaults for certain parameters that were omitted from the DD or SVC
99. Parameters from a data class do not override a DD or SVC 99. If
the DD statement or call to dynamic allocation has a BLKSIZE value
that exceeds 32␠760, that value is in a system control block
that is a logical extension to the JFCB, and the JFCB BLKSIZE field
has a zero value.
- When a DASD data set is opened (or a magnetic tape with standard
labels is opened for INPUT, RDBACK, or INOUT or is being extended),
any field in the JFCB not completed by a DD statement or data class
is filled in from the data set label (if one exists). When you open
a new DASD data set, the system might previously have calculated an
optimal block size and stored it in the data set label. It does that
if RECFM, LRECL, and DSORG are available.
When opening
a magnetic tape for output, the OPEN function usually assumes the
tape labels do not exist or to apply to the current data set. The
exceptions are if you specify DISP=MOD on the DD statement or the
dynamic allocation equivalent, or the OPEN macro has the EXTEND or
OUTINX option and a volume serial number is present. A volume serial
number is present if any of the following is true:
- The data set is cataloged
- The VOLUME parameter of the DD statement or dynamic allocation
has a volume serial number
- The DD statement has VOL=REF that refers to a DD statement with
a volume serial number that is resolved before the open for the DD
statement with VOL=REF
OPEN does not perform a merge from a data set label to
JFCB for a “like” sequential concatenation when making the
transition between data sets. If you want a merge, turn on the unlike
attribute bit (DCBOFPPC) in the DCB. The unlike attribute forces the
system through OPEN for each data set in the concatenation, where
a label to JFCB merge takes place. See Concatenating Unlike Data Sets.
- From the JFCB, OPEN fills in any field not completed in the DCB
or DCBE. This completes what is called the forward merge.
- Certain fields in the DCB or DCBE can then be completed or changed
by your own DCB user exit routine or JFCBE exit routine. The DCB and
DCBE macro fields are described in z/OS DFSMS Macro Instructions for Data Sets. These exits are
described in DCB OPEN Exit and JFCBE Exit.
- After OPEN calls the user's optional DCB OPEN exit or JFCBE exit,
it calls the installation's optional OPEN exit routine. Either type
of exit or both can make certain changes to the DCB and DCBE.
The block size field
(BLKSIZE) is in two bytes in the DCB if you are not using large block
interface (LBI). Its maximum value is 32␠760. The block
size field is in four bytes in the DCBE if you are using LBI. After
possibly calling these exits, OPEN tests if the block size field is
zero or an exit changed LRECL or RECFM after the system calculated
a block size when the DASD data set space was allocated. In either
case, OPEN calculates an optimal block size according to the device
type if the RECFM is not U.
- All DCB fields are then unconditionally merged into corresponding
JFCB fields if your data set is opened for output. This is the beginning
of what is called the reverse merge. Merging the DCB fields is caused
by specifying OUTPUT, OUTIN, EXTEND, or OUTINX in the OPEN macro.
The
DSORG field is merged only when it contains zeros in the JFCB. If
your data set is opened for input (INPUT, INOUT, RDBACK, or UPDAT
is specified in the OPEN macro), the DCB fields are not merged unless
the corresponding JFCB fields contain zeros.
- The open routines use the updated JFCB and associated control
blocks to write the DASD data set labels if the data set was open
for OUTPUT, OUTIN, OUTINX, or EXTEND. For standard labeled tapes,
the open routines write labels only for the OUTPUT or OUTIN options
when you are not extending the data set. You are extending if the
OPEN option is OUTPUT or OUTIN with DISP=MOD or the OPEN option is
OUTINX, EXTEND or INOUT. When extending a standard labeled tape data
set, the EOV and CLOSE functions use the updated JFCB and associated
control blocks to write trailer labels. If the data set is not closed
when your program ends, the operating system closes it automatically.
When the data set is closed, the DCB is restored to the condition
it had before the data set was opened (except that the buffer pool
is not freed) unless you coded RMODE31=BUFF and OPEN accepted it.