Compaq AAQ2G1FTK Marine Radio User Manual


 
Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration
B.4 Compaq COBOL and Compaq COBOL for OpenVMS VAX Behavior Differences
B.4.2.6 REPLACE and COPY REPLACING Statements
For the REPLACE and COPY REPLACING statements, the line numbers in
compiler listing files differ between Compaq COBOL and Compaq COBOL for
OpenVMS VAX. Compaq COBOL arranges the line number for the replacement
line to correspond to its line number in the original source text, while subsequent
line numbers differ. Compaq COBOL for OpenVMS VAX arranges the line
numbers consecutively.
The following source program produces compiler listing files with different ending
line numbers, depending on whether you compile the program with Compaq
COBOL or Compaq COBOL for OpenVMS VAX.
Source File
REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
A
VERY
LONG
STATEMENT.
DISPLAY "To REPLACE or not to REPLACE".
Compaq COBOL Listing File for REPLACE Statement
-----------------------------------------------------------------
1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
2 EXIT PROGRAM.
6 DISPLAY "To REPLACE or not to REPLACE".
Compaq COBOL for OpenVMS VAX Listing File for REPLACE Statement
-----------------------------------------------------------------
1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
2 EXIT PROGRAM.
3 DISPLAY "To REPLACE or not to REPLACE".
The diagnostic messages for the COBOL source statements REPLACE and DATE-
COMPILED result in compiler listing files that contain multiple instances of the
source line.
For a REPLACE statement in a Compaq COBOL program, if the Compaq COBOL
compiler issues a message on the replacement text, the message corresponds to
the original text in the program, as shown in the following compiler listing file.
Compaq COBOL Listing File for REPLACE Statement
18 P0. REPLACE ==xyzpdqnothere==
19 BY ==nothere==.
20
21 copy "drep3hlib".
L 22 display xyzpdqnothere.
...................1
%COBOL-F-UNDEFSYM, (1) Undefined name
LR 22 display nothere.
In a Compaq COBOL for OpenVMS VAX program, the compiler message
corresponds to the replacement text, as shown in the following compiler listing
file.
B14 Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration