Compaq COBOL AAQ2G1FTK User Manual
Page 554
Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration
B.4 Compaq COBOL and Compaq COBOL for OpenVMS VAX Behavior Differences
The Compaq COBOL compiler has no method for determining what data type
an external routine may return. You must specify the correct data type for the
GIVING-VALUE item in the CALL statement. On the Alpha architecture, the
generated code is testing F0 instead of R0 because of the different set of registers
used for floating-point data items.
In the sample program, the value in F0 is unpredictable in this code sequence. In
some cases, this coding practice may produce the expected behavior, but in most
cases it will not.
B.4.6 Diagnostic Messages
Several diagnostic messages have different meanings and results depending upon
the platform on which you are programming:
•
Compaq COBOL does not perform the same run-time error recovery behavior
as Compaq COBOL for OpenVMS VAX upon receipt of the following
diagnostic:
%COBOL-E-EXITDECL, EXIT PROGRAM statement invalid in GLOBAL DECLARATIVE
•
Compaq COBOL for OpenVMS VAX always ignores an EXIT PROGRAM in a
GLOBAL USE procedure. Compaq COBOL ignores the EXIT PROGRAM only
if the GLOBAL USE is invoked from other than the current program unit.
To produce behavior identical to Compaq COBOL for OpenVMS VAX, correct
the problem causing the diagnostic.
•
If one of the operands in a comparison is illegal, both VAX and Compaq
COBOL emit an error message. Compaq COBOL for OpenVMS VAX
continues analyzing the statement containing the conditional, but Compaq
COBOL skips to the next statement (thus not finding any additional errors in
the statement).
•
If a source statement contains multiple divides and the divisor(s) are a literal
zero, a figurative zero, or a variable whose value is zero, Compaq COBOL
issues a single divide-by-zero run-time diagnostic, while Compaq COBOL
for OpenVMS VAX issues the same diagnostic for each divide-by-zero in the
statement. For example, the following code produces three diagnostics with
Compaq COBOL for OpenVMS VAX and only one diagnostic with Compaq
COBOL:
DIVIDE 0 INTO A, B, C.
In accordance with the ANSI COBOL Standard, both compilers allow
execution to continue with unpredictable results.
•
The Compaq COBOL RTL on Tru64 UNIX can give a result that differs from
OpenVMS Alpha in the case where your program tries to create an ISAM
file with two keys that are the same except for the status of the duplicates
(one key specifies DUPLICATES and the other key does not). In this case, on
Tru64 UNIX you will receive the following message (if
-rkc
is not specified):
COB_S_ISAM_BADKEY
ISAM file %s created with two keys that are the same except for
their acceptance of duplicate values
This will be translated into the COBOL status code 39, which is used for a
conflict in file attributes.
Compaq COBOL on OpenVMS Alpha does not allow duplicate keys unless
directed in both key specifications.
B–20 Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration