For OS files and terminal files, the values of RECFM, LRECL, and BLKSIZE are
significant. When you open a file, z/OS® XL C/C++ searches
for the RECFM, LRECL, and BLKSIZE values
in the following places:
- The fopen() or freopen() statement
that opens the file
- The DD statement
(described in DDnames)
- The values set in the existing file
- The default values for fopen() or freopen().
When you call
fopen() and
specify a write mode (
w, wb, w+, wb+, w+b) for an
existing file,
z/OS XL C/C++ uses
the default values for
fopen() if:
- the data set is opened by the data set name or
- the data set is opened by ddname and the DD statement does not
have any attributes filled in.
These defaults are listed in Table 1. To force z/OS XL C/C++ to use
existing attributes when you are opening a file, specify recfm=* (or recfm=+)
on the fopen() or freopen() call.
recfm=* (or recfm=+)
is valid only for existing DASD data sets. It is ignored in all other
cases.
recfm=+ is identical to
recfm=* with
the following exceptions:
- If there is no record format for the existing DASD data set, the
defaults are assigned as if the data set did not exist.
- When append mode is used, the fopen() fails.
Notes: - When specifying a ddname on fopen() or freopen() you
should be aware of the following when opening the ddname using one
of the write modes:
- If the ddname is allocated to an already existing file and that
ddname has not yet been opened, then the DD statement will not contain
the recfm, lrecl, or blksize. That
information is not filled in until the ddname is opened for the first
time. If the first open uses one of the write modes (w,wb,
w+, wb+, w+b) and recfm=* (or recfm=+)
is not specified, then the existing file attributes are not considered.
Therefore, since the DD statement has not yet been filled in, the fopen() defaults
are used.
- If the ddname is allocated at the same time the file is created,
then the DD statement will contain the same recfm, lrecl, and blksize specified
for the file. If the first open uses one of the write modes (w, wb,
w+, wb+, w+b) and recfm=* (or recfm=+)
is not specified, then z/OS XL C/C++ picks
up the existing file attributes from the DD statement since they were
placed there at the time of allocation.
You can
specify the record format in
- The RECFM parameter
of the JCL DD statement
under MVS™
- The RECFM parameter
of the ALLOCATE statement under TSO
- The __recfm field
of the __dyn_t structure
passed to the dynalloc() library
function under MVS
- The RECFM parameter
on the call to the fopen() or freopen() library
function
- The __S99TXTPP text
unit field on an SVC99 parameter list passed to the svc99() library
function under MVS
- The ISPF data set utility under MVS
Certain categories of I/O may ignore or simulate some attributes
such as BLKSIZE or RECFM that
are not physically supported on the device. Table 1 lists all the categories
of I/O that z/OS XL C/C++ supports
and directs you to where you can find more information about them.
You can specify the logical record length in
- The LRECL parameter
of the JCL DD statement
under MVS
- The LRECL parameter
of the ALLOCATE statement under TSO
- The __lrecl field
of the __dyn_t structure
passed to the dynalloc() library
function under MVS
- The LRECL parameter
on the call to the fopen() or freopen() library
function
- The __S99TXTPP text
unit field on an SVC99 parameter list passed to the svc99() library
function under MVS
- The ISPF data set utility
If you are creating a file and you do not select a record size, z/OS XL C/C++ uses
a default. See fopen() defaults for details
on how defaults are calculated.
You can specify the block size in
- The BLKSIZE parameter
of the JCL DD statement
- The BLKSIZE parameter
of the ALLOCATE statement under TSO
- The __blksize field
of the __dyn_t structure
passed to the dynalloc() library
function under MVS
- The BLKSIZE parameter
on a call to the fopen() or freopen() library
function
- The __S99TXTPP text
unit field on an SVC99 parameter list passed to the svc99() library
function under MVS
- The ISPF data set utility
If you are creating a file and do not select a block size, z/OS XL C/C++ uses
a default. The defaults are listed in Table 1.