LRECL and BLKSIZE defaults

Table 1 shows the defaults for LRECL and BLKSIZE when z/OS® XL C/C++ is creating a file, not appending or updating it. The table assumes that z/OS XL C/C++ has already processed any information from the fopen() statement or ddname. The defaults provide a basis for fopen() to select values for unspecified attributes when you create a file.

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 block size for the device. These are the current default maximum block sizes for several devices that z/OS XL C/C++ supports:
Device
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, refer to z/OS DFSMS Using Data Sets.

For DASD files that do not have recfm=U, if you specify blksize=0 on the call to fopen() or freopen(), the system determines the optimal block size for your file. If you do not have the correct level of DFP or you specify blksize=0 for a ddname instead of specifying it on the fopen() or freopen() call, z/OS XL C/C++ behaves as if you had not specified the blksize parameter at all.

For information about block sizes for different categories of I/O, see the topics listed in Table 1.

You do not have to specify the LRECL and BLKSIZE attributes; however, it is possible to have conflicting attributes when you do specify them. The restrictions are:

To determine the maximum LRECL and BLKSIZE values for the various file types and devices available on your operating system, refer to the topics listed in Table 1.