When you move from
Language Environment for
OS/390, Version 2 Release 9 or earlier to
Language Environment for z/OS,
COBOL programs that process RECFM=VB or FB data sets with RECORDING
MODE U might work differently. The application program might require some
modification to work correctly in either of the following cases:
- The application reads a RECFM=VB or FB data set as RECORDING MODE U and
needs to receive an individual record rather than the entire block.
- The application writes to a RECFM=VB data set defined as RECORDING MODE
U and needs to write multiple records per block.
This combination of RECORDING MODE and RECFM created a mismatch that coincidentally
worked in some cases under Language Environment for
OS/390, Version 2 Release 9 or earlier, and some applications exploited this
behavior. Programs that are compiled with CMPR2 do not have this problem,
but inconsistent behavior might occur if the PTF for PQ49479 is not installed.
To determine if this problem is present in your applications, search for
RECORDING MODE U in your source programs. If you do not find references to
RECORDING MODE U, the chances that you will run into this problem are minimal.
However, if you do have programs that use RECORDING MODE U, you need to view
the DD statement and maybe the data set attributes for the file.
- If the DD statement for the file defined as RECORDING MODE U contains
RECFM=U, the application will probably not require any modification to run
under Language Environment for z/OS.
The JCL RECFM=U will override the data set label so that the source
program and attributes that are used to open the file will be consistent.
- If the DD statement for the file defined as RECORDING MODE U contains
RECFM=VB (V or FB also apply), you must modify the application before it will
run under Language Environment for
OS/390, Version 2 Release 10 or Language Environment for
z/OS.
- If the DD statement for the file defined as RECORDING MODE U does not
contain any RECFM= specification, you need to view the data set attributes.
If the RECFM for the data set is RECFM=VB, V, or FB, you must modify the application before
it will run under Language Environment for z/OS.
Your changes must ensure that the RECORDING MODE of the file is consistent
with the RECFM of the data set when the file is opened. Following are your
options for modifying your applications:
- You can modify your source to use RECORDING MODE V and format 3 of the
RECORD clause "RECORD IS VARYING FROM n TO nn DEPENDING ON data-name-1" in
order to process variable-length records. A read done from a file that was
defined using this record clause would receive the length of the record that
was just read in data-name-1. If the file is variable-blocked, add a BLOCK
CONTAINS clause.
- You can continue to process the file as RECORDING MODE U, but you must
ensure that the application can handle a true RECFM=U file. To verify that
the application handles the file correctly, use a JCL override of RECFM=U
and run the application. Examine the results of the processing to ensure that
the application did correctly process the records that were read and written
with true format U processing.
- Ensure that the format of the data set is RECFM=U. To set this format,
you can use a JCL override of the true RECFM or define format U as the true
RECFM for the data set. Before using this option, you must verify that your
application can correctly process the records that are returned with true
format U processing.
In true format U processing, each read from the file receives an entire
block (because format U records are written so that each block is a single
record) which will be passed back to the application. If the data set is variable
blocked (RECFM=VB) or fixed blocked (RECFM=FB), the block that is returned
to the application will consist of multiple records that must be deblocked
by the application. Additionally each write to a format U file will create
a new block for each record. If a write is done to an existing file that was
originally written as RECFM=VB or RECFM=FB, the blocks written as RECFM=U
will contain a single record, whereas those written as RECFM=FB or RECFM=VB
can contain multiple records. The RECFM will also be changed to U if a write
is done.
A mismatch between the RECORDING MODE of the file and RECFM of the data
set can also exist when RECORDING MODE V or F is coded in your COBOL source
and the data set is RECFM=U. Although this coding might currently work, it
is recommended that the RECORDING MODE and RECFM are changed to match. In
the future, changes to Language Environment might
cause your applications with a mismatch between the RECORDING MODE for the
file and the RECFM for the data set to fail.