COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-66
COBOL_SET_MAX_RECORD_
COBOL_SET_MAX_RECORD_
The COBOL_SET_MAX_RECORD_ routine sets the maximum record size in the
COBOL internal file block.
This routine is typically used to allow one file description (FD) to be used to write and
read files whose maximum record lengths are less than or equal to that specified in the
COBOL program. Without the use of this routine, if the file has a maximum record
length that is shorter than that specified in the program, you can open the file in INPUT
mode, but not in EXTEND or I-O mode.
file-name
is the COBOL file name of the file to be affected. It must be the name of a file
defined by an FD, not a sort-merge file description (SD). In the non-CRE
environment, the FD cannot contain the EXTERNAL phrase. At the time the
ENTER statement is executed, the file connector referenced by file-name must
not be open.
new-length
is the new maximum record size. It must be less than 4096 and must not be larger
than the length specified in the RECORD clause in the FD; if no RECORD clause
is specified, new-length must not be larger than the largest record description
associated with the FD. The compiler cannot determine if the new size is too large;
improper use can cause corruption when reading the file. It is your responsibility to
ensure this does not happen.
If you omit new-length, the run-time system queries the file that will be assigned
when the file is opened and uses the maximum record length from that file.
ENTER COBOL_SET_MAX_RECORD_
"
USING
new-length
resultGIVING
"
ns ns
file-name
VST737.vsd