DCB (Data Control Block) attributes

For OS files, the C runtime library creates a skeleton data control block (DCB) for the file when you open it. File attributes are determined from the following sources in this order:

  1. The fopen() or freopen() function call
  2. Attributes for a ddname specified previously (if you are opening by ddname)
  3. Existing file attributes (if you specify recfm=* or you are opening an existing file for read or append)
  4. Defaults from fopen() or freopen() for creating a new file.
If you do not specify RECFM when you are creating a new file, z/OS® XL C/C++ uses the following defaults:
If recfm is not specified for a record I/O or blocked I/O file, you will get the default of recfm=VB. Table 1 shows the defaults for LRECL and BLKSIZE when the z/OS XL C/C++ compiler creates an OS file. Information from the C or C++ program overrides that from the DD statement and the tape label. Information from the DD statement overrides that from the data set label.
Figure 1. How the operating system completes the DCB
Graphic showing how the operating system completes the DCB
Table 1. fopen() defaults for LRECL and BLKSIZE when creating OS files
lrecl specified? blksize specified? RECFM LRECL BLKSIZE
no no All F 80 80
All FB 80 maximum integral multiple of 80 less than or equal to max
All V, VB, VS, or VBS minimum of 1028 or max–4 max
All U 0 max
yes no All F lrecl lrecl
All FB lrecl maximum integral multiple of lrecl less than or equal to max
All V lrecl lrecl+4
All U 0 lrecl
no yes All F or FB blksize blksize
All V, VB, VS, or VBS minimum of 1028 or blksize–4 blksize
All U 0 blksize
Note: All includes the standard (S) specifier for fixed formats, the ASA (A) specifier, and the machine control character (M) specifier.
In Table 1, the value max represents the maximum reasonable block size for the device. These are the current default maximum block sizes for several devices that z/OS XL C/C++ supports:
Device
Default maximum block size
DASD
6144
3203 Printer
132
3211 Printer
132
4245 Printer
132
2540 Reader
80
2540 Punch
80
2501 Reader
80
3890 Document Processor
80
TAPE
32760

For more information about specific default block sizes as returned by the DEVTYPE macro, refer to z/OS DFSMS Using Data Sets.

You can perform multiple buffering under z/OS. See Multiple buffering for details.