HP OpenVMS Systems Documentation

Content starts here

HP COBOL
User Manual


Previous Contents Index

C.5.5 For More Information

For more information about Oracle CDD/Repository, refer to the following manuals:
Document Description
Oracle CDD/Repository Architecture Manual Describes the concepts and capabilities of the Oracle CDD/Repository object-oriented architecture.
Using Oracle CDD/Repository on OpenVMS Systems Provides tutorial information for Oracle CDD/Repository users
Oracle CDD/Repository CDO Reference Manual Provides reference information for the Common Dictionary Operator (CDO) utility
Oracle CDD/Repository Callable Interface Manual Explains how to use the ATIS callable interface
Oracle CDD/Repository Information Model Volume I,
CDD/Repository Information Model Volume II
Contain reference information on the ATIS and Oracle CDD/Repository type hierarchy

<>


Appendix D
Porting to HP COBOL from Other Compilers (Alpha, I64)

HP COBOL has built-in porting assistance that recognizes foreign COBOL extensions and helps you migrate programs from other systems. Porting assistance is always enabled for some foreign extensions. However, for those features that use new reserved words, this feature is selectively enabled at compile time by qualifiers and flags on the COBOL command line.

Porting assistance provides the following features:

  • The ability to detect syntax from other COBOL implementations
  • The process of applying foreign reserved words (in other words, from other COBOL implementations) in the presence of foreign COBOL extension syntax
  • Messages to help you recode those program steps that use the foreign extensions
  • Support for selected syntax synonyms used in other COBOL implementations

D.1 Porting Assistance

HP COBOL porting assistance can help you port programs from other COBOL implementations to HP COBOL. It does so by recognizing and reporting occurrences of known extensions from other COBOL implementations that are not implemented in HP COBOL (hence "foreign" extensions).

Some porting assistance is always present. Foreign extensions that do not need new reserved words are always recognized and diagnosed as foreign extensions (or, in a few cases, implemented as new features of HP COBOL).

The default is for full porting assistance to be turned off, but you can enable it at compile time by adding the foreign extensions option to the COBOL command. The option can be negated by a NO prefix. It can be used in combination with other options, and is independent of those options. See Table 1-2, HP COBOL Command Flags on Tru64 UNIX and Table 1-4, COBOL Command Qualifiers for option syntax and defaults.

You enable full porting assistance by adding the foreign extensions option to the compile command as follows:

On OpenVMS


  /RESERVED_WORDS=FOREIGN_EXTENSIONS

On Tru64 UNIX


  -rsv foreign_extensions

Without full porting assistance enabled, if you compile program source code that was written for a compiler other than HP COBOL, extensions that are not directly supported by HP 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 HP 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 HP 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 HP 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 produce fatal diagnostic messages for programs that have successfully compiled before.

D.2 Flagged Foreign Extensions

HP COBOL porting assistance recognizes the foreign syntax shown in the following list and provides helpful diagnostic messages when they are encountered:

  • ADDRESS OF in CALL statement
  • ADDRESS OF in SET statement
  • AFTER POSITIONING in WRITE statement
  • EJECT statement
  • ENTER statement
  • ENTRY statement
  • EXAMINE statement
  • GOBACK statement
  • ON statement
  • PURGE statement
  • RECEIVE statement
  • SEND statement
  • SERVICE statement
  • SKIP statement
  • TRANSFORM statement
  • PASSWORD for SELECT statement
  • DISPLAY-1 as PICTURE USAGE
  • FILE STATUS with a second target
  • LENGTH OF in CALL USING statement

The last two features in this list are always detected. All others in the list are under control of the foreign extensions option because they require recognition of foreign reserved words.

D.3 Implemented Extensions

The following foreign extensions are implemented in HP COBOL to make it easier to port programs:

  • ZEROES and ZEROS can be used in a BLANK WHEN ZERO clause.
  • EQUAL can be used instead of the equal sign (=) in a COMPUTE statement.
  • An empty INPUT-OUTPUT section is accepted and flagged with an Informational message, rather than issuing a Fatal message.
  • The REMARKS paragraph can be used in the Identification Division.

The last feature in this list is under control of the foreign extensions option because it requires the foreign reserved word REMARKS. The other extensions are provided in HP COBOL. <>


Index Contents