Compaq COBOL AAQ2G1FTK User Manual

Page 560

Advertising
background image

Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration
B.5 Compaq COBOL Differences Across Operating Systems

B.5.3 VFC File Format

If a VFC file is created on OpenVMS Alpha and then read on Windows NT or
Tru64 UNIX, the data record will be returned with the 2-byte control string in
the data record when it is read.

The workaround is to convert the file to a non-VFC format on OpenVMS Alpha.
VFC files are created on OpenVMS Alpha by Compaq COBOL for OpenVMS VAX
and Compaq COBOL for the following:

LINAGE
REPORT WRITER
SEQUENTIAL EXTERNAL/GLOBAL
Output with WRITE ADVANCING

B.5.4 File Attribute Checking

Compaq COBOL on Tru64 UNIX and Windows NT systems provides limited file
attribute checking. No file attribute checking is performed for sequential and
relative files. For indexed files, Compaq COBOL verifies that the following file
attributes match what is specified in the application:

Number of keys

Size and position (within the record structure) of each key

Whether or not duplicates are allowed for each key

If these attributes are not matching, the file will not be opened and a fatal
runtime error will occur (or Declaratives will be invoked, if applicable).

However, with the relax key checking option selected Compaq COBOL will allow
you to open a file which specifies fewer keys than were specified when the file
was originally created. This option will provide correct results only in those cases
where the unspecified keys are USAGE DISPLAY (PIC X). Also,

-rkc

allows you

to open a file which specifies DUPLICATES for a key in a way differently from
the specification given when the file was created.

There is an additional check in creating an indexed file: unless relax key
checking is specified, you may not have two keys that are identical except for
whether DUPLICATES are allowed. If this restriction is violated, there will be
an explicit run-time error message and those operations that are affected by
DUPLICATES may give unexpected results.

B.5.5 Indexed Files

Compaq COBOL on Tru64 UNIX and Windows NT treats indexed files differently
from the way they are treated by both Compaq COBOL on OpenVMS Alpha and
Compaq COBOL for OpenVMS VAX on OpenVMS Alpha. Specifically:

For an indexed file, the run-time system creates two files on the disk: one file
with the dat extension, and the other file with the idx extension. Additionally,
on Windows NT a file with the lck extension is created.

If you try to open an indexed file as a sequential file, the key part of any
record other than a character key will be different. The reason is that the
keys in a record are translated to a file format on disk.

When you open an existing indexed file, the RTL checks its key structure and
returns a severe error if there is a serious mismatch.

B–26 Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration

Advertising