Compaq COBOL
User Manual


Previous Contents Index

C.6.4 Data Types

Oracle CDD/Repository supports some data types that are not native to Compaq COBOL. If a data definition contains a field declared with an unsupported data type, Compaq COBOL issues a fatal diagnostic. The Compaq COBOL compiler does not attempt to approximate a data type that it does not support.

Table C-1 shows how Oracle CDD/Repository data types are translated into COBOL data types. It also states the level of support Compaq COBOL provides for Oracle CDD/Repository data types.

Table C-1 Oracle CDD/Repository Data Types
Data Type Level of Support
UNSPECIFIED U
SIGNED BYTE W
UNSIGNED BYTE W
SIGNED WORD S
UNSIGNED WORD W
SIGNED LONGWORD S
UNSIGNED LONGWORD W
SIGNED QUADWORD S
UNSIGNED QUADWORD W
SIGNED OCTAWORD S
UNSIGNED OCTAWORD W
F_FLOATING S
F_FLOATING COMPLEX W
D_FLOATING S
D_FLOATING COMPLEX W
G_FLOATING S
G_FLOATING COMPLEX W
H_FLOATING W
H_FLOATING COMPLEX W
UNSIGNED NUMERIC S
LEFT OVERPUNCHED NUMERIC S
LEFT SEPARATE NUMERIC S
RIGHT OVERPUNCHED NUMERIC S
RIGHT SEPARATE NUMERIC S
PACKED DECIMAL S
ZONED NUMERIC W
BIT W
DATE W
TEXT S
VARYING STRING W
POINTER S
VIRTUAL FIELD W
SEGMENTED STRING W
REAL S
ALPHABETIC S


S --Fully supported
W---The data type is translated into a supported type and a diagnostic message is issued.
U---The data type is unsupported and a fatal diagnostic message is issued.

C.6.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 Compaq COBOL from Other Compilers

Compaq 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:

D.1 Porting Assistance

Compaq COBOL porting assistance can help you port programs from other COBOL implementations to Compaq COBOL. It does so by recognizing and reporting occurrences of known extensions from other COBOL implementations that are not implemented in Compaq 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 Compaq 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, Compaq 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 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 produce fatal diagnostic messages for programs that have successfully compiled before.

D.2 Flagged Foreign Extensions

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

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 Compaq COBOL to make it easier to port programs:

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 Compaq COBOL.


Index Contents