Replace And Copy Replacing Statements - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

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
Compaq COBOL Listing File for REPLACE Statement
Compaq COBOL for OpenVMS VAX Listing File for REPLACE Statement
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
In a Compaq COBOL for OpenVMS VAX program, the compiler message
corresponds to the replacement text, as shown in the following compiler listing
file.
B–14 Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration
REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
A
VERY
LONG
STATEMENT.
DISPLAY "To REPLACE or not to REPLACE".
-----------------------------------------------------------------
1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
2 EXIT PROGRAM.
6 DISPLAY "To REPLACE or not to REPLACE".
-----------------------------------------------------------------
1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
2 EXIT PROGRAM.
3 DISPLAY "To REPLACE or not to REPLACE".
18 P0.
19
20
21
L
22
...................1
%COBOL-F-UNDEFSYM, (1) Undefined name
LR
22
display nothere.
REPLACE ==xyzpdqnothere==
BY ==nothere==.
copy "drep3hlib".
display xyzpdqnothere.

Advertisement

Table of Contents
loading

Table of Contents