Compaq COBOL AAQ2G1FTK User Manual

Page 588

Advertising
background image

Porting to Compaq COBOL from Other Compilers
D.1 Porting Assistance

-rsv foreign_extensions

Without full porting assistance enabled, if you compile program source code that
was written for a compiler other than Compaq COBOL, extensions that are not
directly supported by Compaq COBOL are flagged with terse messages and the
compile fails. Porting assistance will provide you with better diagnostics and
more information that can assist you in recoding the indicated operations with
Compaq COBOL syntax.

When full porting assistance is on, the compiler recognizes each occurrence of
certain extensions from other COBOL implementations (shown in Table D–1),
and outputs a diagnostic that identifies that foreign extension.

For example, your program might contain the following line:

EXAMINE Y REPLACING ALL "A" BY "Z".

In the absence of the porting assistance, the compiler will output this message:

Invalid statement syntax

The previous message is accurate, but does not lead you to a resolution.

If you enable porting assistance, you will receive a message that is much more
helpful, as follows:

Foreign extensions, EXAMINE statement, not implemented
Invalid statement syntax

The previous message clearly identifies the foreign statement (in this case,
EXAMINE), so that you can replace it with the equivalent Compaq COBOL
statement.

When full porting assistance is on, the reserved words shown in Table D–1 are
added to those shown in the Reserved Words appendix in the Compaq COBOL
Reference Manual
.

Table D–1 Recognized Foreign Reserved Words

ADDRESS

CHANGED

CORE-INDEX

DBCS

DISP

DISPLAY-1

EJECT

ENTRY

EXAMINE

EXHIBIT

GOBACK

ID

KANJI

NAMED

NOTE

OTHERWISE

PASSWORD

POSITIONING

RECORDING

RECORD-OVERFLOW

RELOAD

REMARKS

REORG-CRITERIA

RETURNING

SERVICE

SKIP1

SKIP2

SKIP3

TRACE

TRANSFORM

Ordinarily, the compiler simply treats a declaration of any of these words as
a fatal error. The porting assistance option can issue a meaningful diagnostic
message that can guide you to appropriate recoding.

Full porting assistance is placed under control of the foreign extensions option,
rather than running at all times. Although the porting assistance is useful
for porting many programs with foreign extensions, it is not useful with all
programs, because the new reserved words may conflict with declared names and

D–2 Porting to Compaq COBOL from Other Compilers

Advertising