# Compaq COBOL
User Manual

Previous | Contents | Index

# Appendix B
Compaq COBOL on Three Platforms: Compatibility and Migration

Compaq COBOL on its Alpha platforms (OpenVMS and Tru64 UNIX) is based on and is highly compatible with Compaq COBOL for OpenVMS VAX. However, there are differences, which are summarized in this appendix.1 Knowing the differences can help you develop COBOL applications that are compatible with other platforms, and can help you migrate your Compaq COBOL for OpenVMS VAX applications to Compaq COBOL on an Alpha platform.

Note #### 1 Because this appendix is comparative and full of system-specific information, the diamond (<>) that elsewhere in the manual signals the end of system-specific sections is not used here except once, at the end of the appendix.

# B.1 Compatibility Matrix

Table B-1 shows the current (as of the date of publication of this manual) state of compatibility for numerous features in Compaq COBOL on its three platforms. Always check the Release Notes for the latest developments if there is a question about the availability of a given feature.

    Legend
     X       = Supported
     N       = Not supported
     P       = Partially supported

Table B-1 Cross-Platform Compatibility of COBOL Features
| OpenVMS VAX | OpenVMS Alpha | Tru64 UNIX
--- | --- | --- | ---
/CHECK=DECIMAL | N | X | X
/CHECK=(PERFORM,BOUNDS) | X | X | X
/STANDARD=V3 | X | P | P
18-digit intermediates | X | X | X
31-digit user items | N | X | X
32-digit intermediates | N | X | X
64-bit pointers | N | P | X
ACCEPT/DISPLAY BLINK | X | X | X
ACCEPT/DISPLAY WITH CONVERSION | X | X | X
ACCEPT/DISPLAY, extended | X | X | X
ACCEPT support for four-digit years | X | X | X
Alignment: Alpha natural, and padding | N | X | X
Alignment: VAX compatible | X | X | X
ANSI-74 FILE STATUS support | X | X | X
ANSI-85 REPORT WRITER | X | X | X
ANSI-85/-89/-93 HIGH | X | X | X
Arithmetic, standard | N | P | P
CALL USING BY DESCRIPTOR | X | X | N
Floating point: "E" literal | X | X | X
Floating point: F,D floating | X | X | N
Floating point: G floating | N | X | N
Floating point: IEEE S,T floating | N | X | X
FUNCTION ARGCOUNT | X | X | N
Internationalization (PIC N, etc.) | X | X | X
Invalid decimal data checking | P | P | P
ISAM key checking | X | X | X
ISAM keys, segmented | X | X | X
ISAM READ PRIOR/START LESS | N | X | X
Little-endian COMP data | X | X | X
Locking: UCX/NFS support (nolocking) | N | N | X
Locking: file sharing and record locking | X | X | X
Oracle CDD/DML support | X | X | N
Reformat | X | X | X
RMS special registers | X | X | N
Symbolic debugger support | X | X | X
SYS$CURRENCY | X | X | N
Table sort | N | X | X
Tape handling | X | X | X
Terminal source format | X | X | X
Tools: |  |  |
DECset PCA, LSE/SCA support | X | X | N
DECset PDF support | X | N | N
FUSE support | N | N | X
Transarc Encina (-tps) support | N | N | X
VFC, print control files with | X | X | N
VFC, print control files without | N | X | X
X/Open | N | P | P
ASSIGN TO | N | X | X
Command line | N | X | X
COMP-5/COMP-X | N | X | X
DISPLAY ON EXCEPTION | N | X | X
Environment variables | N | X | X
File sharing / record locking | N | X | X
LINE SEQUENTIAL | N | X | X
RETURN-CODE | N | X | X
SCREEN SECTION | N | X | X
Y2K intrinsic functions | X | X | X

# B.2 Differences in Extensions and Other Features

Compaq COBOL on Alpha contains the following language extensions and other features that are not in Compaq COBOL on VAX:

- A choice of alignment (with the /ALIGNMENT qualifier or `-align` flag) on the compile command line or as a source directive for individual records; you can select Alpha data alignment for performance or VAX data alignment for compatibility.
- A qualifier or flag (/ARCHITECTURE or `-arch` ) that enhances performance through targeted code generation.
- A qualifier or flag (/ARITHMETIC or `-arithmetic` ) that selects native or standard arithmetic.
- A qualifier or flag (/CONVERT=LEADING_BLANKS or `-convert leading_blanks` ) that changes all blanks to zeros in numeric display items in arithmetic expressions or statements.
- A qualifier or flag (/DISPLAY_FORMATTED or `-display_formatted` ) that causes the proper display of numeric values without the use of WITH CONVERSION on the DISPLAY statement.
- A qualifier (/FLOAT) on OpenVMS Alpha that selects IEEE or VAX floating-point data types for single- and double-precision data items.
  On Tru64 UNIX, only IEEE floating point is supported.
- A qualifier or flag (/INCLUDE or `-include` ) to control where the compiler searches for files for simple COPY statements.
- A qualifier or flag (/MATH_INTERMEDIATE or `-math_intermediate` ) to specify the intermediate data type for extended arithmetic precision and/or compatibility.
- A qualifier or flag (/OPTIMIZE=TUNE or `-tune` ) that improves optimization through instruction scheduling, and a choice of levels of optimization (with /OPTIMIZE=LEVEL or `-On` .)
- A qualifier or flag (/RESERVED_WORDS or `-rsv` ) to recognize or not to recognize additional COBOL reserved words defined by the X/Open Portability Guide, words that are foreign extensions, or selected words that are reserved as defined by the draft ANSI Standard for COBOL.
- A qualifier (/TIE) on OpenVMS Alpha to generate code that allows native OpenVMS Alpha images to call translated VAX images and translated VAX images to call native OpenVMS Alpha images.
- COMP-5 and COMP-X as synonyms for COMP.
- READ PRIOR and START LESS.
- X/Open ASSIGN TO, LINE SEQUENTIAL, RETURN-CODE, SCREEN SECTION, FILE-SHARING, and RECORD-LOCKING.

Compaq COBOL on Alpha does not contain the following VAX features:

- The DECset/LSE Program Design Facility, the /DESIGN qualifier, design comments, or pseudocode placeholders.

Compaq COBOL on Alpha includes the following:

- Support for the relevant subset of the features in the Compaq COBOL on VAX /STANDARD=V3 qualifier. See Section B.3.3.
- Support for file status values that are compatible with Compaq COBOL for OpenVMS VAX Version 5.1 or higher. These differ from those of Version 5.0 and previous versions.

# B.3 Command-Line Qualifiers (Options or Flags)

Sections B.3.1 , B.3.2 , and B.3.3 compare the Compaq COBOL command-line qualifiers and flags on the three operating systems. For more information about Compaq COBOL command-line qualifiers on the OpenVMS Alpha or VAX operating system, invoke the online help facility: Type `HELP COBOL` at the OpenVMS system prompt. For more information on the flags, refer to the man page: Type `man cobol` at the Tru64 UNIX system prompt.

## B.3.1 Qualifiers and Flags Shared by Compaq COBOL on Alpha and VAX

Table B-2 lists the OpenVMS command-line qualifiers shared by Compaq COBOL on Alpha and VAX and the equivalent flags on Tru64 UNIX.

Table B-2 Qualifiers Shared by Compaq COBOL for OpenVMS Alpha and VAX and Equivalent Tru64 UNIX Flags and Options
OpenVMS Qualifier | Equivalent Tru64 UNIX Flag1
--- | ---
/ANALYSIS_DATA | None
/ANSI_FORMAT | `-ansi`
/AUDIT | None
/CHECK 2 | `-check`
/CONDITIONALS | `-conditionals`
/COPY_LIST | `-copy_list`
/CROSS_REFERENCE | `-cross_reference`
/DEBUG | `-g`
/DEPENDENCY_DATA | None
/DIAGNOSTICS | None
/FIPS 2 | `-fips 74`
/FLAGGER | `-flagger`
/LIST | `-list`
/MACHINE_CODE | `-machine_code`
/MAP | `-map`
/NATIONALITY={JAPAN|US} | `-nationality {japan|us}`
/OBJECT | None
/SEQUENCE_CHECK | `-sequence_check`
/STANDARD 2 | `-std`
/STANDARD=MIA | `-std mia`
/TRUNCATE | `-trunc`
/WARNINGS | `-warn`

1The flags are generally equivalent in features to the qualifiers, except that flags do not have a negative form.
2There are some differences in behavior and features between Compaq COBOL on Alpha and VAX. See the specific documentation for details.

/NATIONALITY={JAPAN|US}, -nationality japan

When /NATIONALITY=JAPAN or `-nationality japan` is specified, the yen sign (¥) is the default currency sign and symbol, and Japanese Language Support features are enabled. Also, in this case /NODIAGNOSTICS and /NOANALYSIS_DATA are specified implicitly.

Oracle CDD/Repository is not supported when /NATIONALITY=JAPAN is used.

When /NATIONALITY=US or `-nationality us` is specified on the compile command line, the dollar sign ($) is the default currency sign and symbol, and Japanese Language Support features are disabled.

/STANDARD=MIA, -std mia

If /STANDARD=MIA or `-std mia` are present on the compile command line, the compiler will issue informational diagnostics for those language elements that do not conform to the MIA specifications:

- Compaq syntax extension from Base Standards (ANSI-85, JIS-88)
- Two of four optional modules
- All obsolete language elements of required modules in Base Standards
- Language elements omitted from required modules in Base Standards because of the different implementation of the vendors
- Compaq specific Japanese features out of MIA Extension Elements related to Japanese

To receive the diagnostics, the `-warn all` flag, /WARNINGS=ALL qualifier, `-warn information` flag, or /WARNING=INFORMATION qualifier is required.

The default is NOMIA.

## B.3.2 Alpha-Specific COBOL Qualifiers and Flags

Table B-3 lists the command-line qualifiers and flags for features specific to Compaq COBOL on Alpha and not available on VAX.

Table B-3 Compaq COBOL on Alpha Options Not Available on VAX
OpenVMS Alpha Qualifier | Tru64 UNIX Flag
--- | ---
/ALIGNMENT | `-align`
/ARCHITECTURE= keyword | `-arch` keyword
/ARITHMETIC=NATIVE | `-arithmetic native`
/ARITHMETIC=STANDARD | `-arithmetic standard`
No equivalent qualifier | `-c`
No equivalent qualifier | `-call_shared`
/CHECK=DECIMAL | `-check decimal`
/CONVERT=LEADING_BLANKS | `-convert leading_blanks`
No equivalent qualifier | `-cord`
No equivalent qualifier | `-D num`
/DISPLAY_FORMATTED | `-display_formatted`
No equivalent qualifier | `-feedback file`
/FLOAT=D_FLOAT | No equivalent flag
/FLOAT=G_FLOAT | No equivalent flag
/FLOAT=IEEE_FLOAT | No equivalent flag
/GRANULARITY= keyword | `-granularity keyword`
/INCLUDE | `-include`
No equivalent qualifier | `-K`
No equivalent qualifier | `-L`
No equivalent qualifier | `-L dir`
No equivalent qualifier | `-l string`
/MATH_INTERMEDIATE=CIT3 | `-math_intermediate cit3`
/MATH_INTERMEDIATE=CIT4 | `-math_intermediate cit4`
/MATH_INTERMEDIATE=FLOAT | `-math_intermediate float`
No equivalent qualifier | `-names as_is`
No equivalent qualifier | `-names lowercase`
No equivalent qualifier | `-names uppercase`
No equivalent qualifier | `-nolocking`
No equivalent qualifier | `-non_shared`
/OPTIMIZE=LEVEL= n | `-O n`
No equivalent qualifier | `-p[ n]`
No equivalent qualifier | `-relax_key_checking`
/RESERVED_WORDS=[NO]200X | `-rsv [no]200x`
/RESERVED_WORDS=[NO]FOREIGN_EXTENSIONS | `-rsv [no]foreign_extensions`
/RESERVED_WORDS=[NO]XOPEN | `-rsv [no]xopen`
No equivalent qualifier | `-shared`
No equivalent qualifier | `-T [ num]`
No equivalent qualifier | `-taso`
/TIE | No equivalent flag
No equivalent qualifier | `-tps`
/TUNE= keyword | `-tune` keyword
No equivalent qualifier | `-V`
No equivalent qualifier | `-v`
No equivalent qualifier | `-xref` , `-xref_stdout`

Previous | Next | Contents | Index