Compaq COBOL
User Manual


Previous Contents Index

B.3.2 Compaq COBOL Specific Qualifiers and Flags

Table B-3 lists the command-line qualifiers and flags for features specific to Compaq COBOL. These qualifiers and flags are not available in Compaq COBOL for OpenVMS VAX.

Table B-3 Compaq COBOL Options Not Available in Compaq COBOL for OpenVMS VAX
OpenVMS Alpha Qualifier,
Windows NT Option
Tru64 UNIX Flag
/ALIGNMENT -align
/ARCHITECTURE= keyword -arch keyword
/ARITHMETIC=NATIVE -arithmetic native
/ARITHMETIC=STANDARD -arithmetic standard
/C 1 -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 2 No equivalent flag
/FLOAT=G_FLOAT 2 No equivalent flag
/FLOAT=IEEE_FLOAT 2 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
/NAMES=AS_IS 1 -names as_is
/NAMES=LOWER 1 -names lowercase
/NAMES=UPPER 1 -names uppercase
/NOLOCKING 1 -nolocking
No equivalent qualifier -non_shared
/OPTIMIZE=LEVEL= n 3 -O n
/OPTIMIZE= n 4 -O n
/OPTIMIZE=TUNE= keyword 5 -tune keyword
No equivalent qualifier -p[ n]
/RELAX_KEY_CHECKING 1 -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
/SEPARATE_COMPILATION 7 No equivalent flag
No equivalent qualifier -shared
No equivalent qualifier -T [ num]
No equivalent qualifier -taso
/TIE 2 No equivalent flag
No equivalent qualifier -tps
/TUNE= keyword 6 -tune keyword
No equivalent qualifier -V
/VERBOSE 1 -v
/VFC 7 No equivalent flag
No equivalent qualifier -xref , -xref_stdout


2Not available on Windows NT.
1Not available on OpenVMS Alpha.
3OpenVMS Alpha form; see /OPTIMIZE=n for Windows NT equivalent.
4Windows NT form; see /OPTIMIZE=LEVEL=n for OpenVMS Alpha equivalent.
5OpenVMS Alpha form; see /TUNE for Windows NT equivalent.
6Windows NT form; see /OPTIMIZE=TUNE for OpenVMS Alpha equivalent.
7The action of Compaq COBOL on OpenVMS Alpha with this qualifier is designed to closely match the default action with Compaq COBOL for OpenVMS VAX. This qualifier is not available on Windows NT.

/ALIGNMENT=PADDING, -align padding

The Compaq Alpha Calling Standards require that data fields be aligned on specific addresses (shown in those standards). The same standards specify that the lengths of all data records and group data items must be multiples of their alignments.

If /ALIGNMENT=PADDING or -align padding is present on the compile command line, COBOL group data-items will be aligned on their natural boundaries and those group items will be padded out to multiples of their alignments. See the Compaq COBOL Reference Manual for detailed information about elementary data item alignment with Alpha alignment and padding in effect.

B.3.3 Qualifiers Only on Compaq COBOL for OpenVMS VAX

Table B-4 lists the command-line qualifiers and qualifier-option combinations that are specific to Compaq COBOL for OpenVMS VAX. These are not available in Compaq COBOL, and there are no equivalent flags.

Table B-4 Compaq COBOL for OpenVMS VAX Specific Qualifiers
Qualifier Comments
/DESIGN Controls whether the compiler processes the input file as a detailed design.
/INSTRUCTION_SET[=option] Improves run-time performance on single-chip VAX processors, using different portions of the VAX instruction set.
/STANDARD=OPENVMS_AXP Produces informational messages on language features that are not supported by the Compaq COBOL compiler. (See /STANDARD=OPENVMS_AXP and the Compaq COBOL for OpenVMS VAX Version 5.1 release notes.)
/STANDARD=PDP11 Produces informational messages on language features that are not supported by the COBOL-81 compiler.
/WARNINGS=STANDARD Produces informational messages on language features that are Compaq extensions. The Compaq COBOL equivalent is the /STANDARD=SYNTAX qualifier or the -std syntax flag.

/STANDARD=V3, -std v3

Compaq COBOL does not support a number of features supported by the Compaq COBOL for OpenVMS VAX implementation of the /STANDARD=V3 qualifier and the -std v3 flag:

The /WARNINGS=ALL qualifier and -warn all flag can help you determine the effects of /STANDARD=V3 and -std v3 ; in particular, Compaq COBOL will generate the following informational messages if /STANDARD=V3 or -std v3 has been specified:

For full information on the Compaq COBOL for OpenVMS VAX implementation of the /STANDARD=V3 qualifier, see the appendix on qualifiers in the VAX COBOL User Manual.

/STANDARD=OPENVMS_AXP

Compaq COBOL for OpenVMS VAX Version 5.1 (and higher) provides a flagging system, via the /STANDARD=OPENVMS_AXP qualifier option, to identify language features in your existing Compaq COBOL for OpenVMS VAX programs that are not available in Compaq COBOL on the OpenVMS Alpha system. (There may be additional language features not available on Windows NT and the Tru64 UNIX system.)

When you specify /STANDARD=OPENVMS_AXP, the Compaq COBOL for OpenVMS VAX compiler generates informational messages to alert you to language constructs that are not available in Compaq COBOL. (You must also specify /WARNINGS=ALL or /WARNINGS=INFORMATIONAL to receive these messages.) You can use this information to modify your program before using Compaq COBOL.

Specify /STANDARD=NOOPENVMS_AXP, which is the default, to suppress these informational messages.

B.4 Compaq COBOL and Compaq COBOL for OpenVMS VAX Behavior Differences

This section describes behavior differences between Compaq COBOL for OpenVMS VAX and Compaq COBOL.

B.4.1 Program Structure Messages

In some cases, the Compaq COBOL compiler (whether on the OpenVMS Alpha, Windows NT, or the Tru64 UNIX system) generates more complete messages about unreachable code or other logic errors than does the Compaq COBOL for OpenVMS VAX compiler.

The following example illustrates a sample program and the messages issued by the Compaq COBOL compiler:

Source file


       IDENTIFICATION DIVISION. 
       PROGRAM-ID. T1. 
       ENVIRONMENT DIVISION. 
       PROCEDURE DIVISION. 
       P0. 
           GO TO P1. 
       P2. 
           DISPLAY "This is unreachable code". 
       P1. 
           STOP RUN. 

On OpenVMS VAX systems


$ COBOL /ANSI/WARNINGS=ALL T1.COB
$

The program compiles. The Compaq COBOL for OpenVMS VAX compiler produces no messages.

On OpenVMS Alpha systems


$ COBOL/ANSI/OPTIMIZE/WARNINGS=ALL T1.COB
       P2. 
.......^ 
%COBOL-I-UNREACH, code can never be executed at label P2 
at line number 7 in file DISK$YOURDISK:[TESTDIR]T1.COB;1

On Tru64 UNIX systems


% cobol -ansi -O -warn all T1.COB
cobol: Info: T1.COB, line 7: code can never be executed at label P2 
       P2 
-------^

On Windows NT systems


C:\>  cobol/OPTIMIZE=4/WARN=ALL T1.COB
T1.COB(7) : Info: code can never be executed at label P2       
P2. 
^

Compaq COBOL is an optimizing compiler. One use of optimization is to perform analysis for uncalled routines and unreachable paragraphs. The compiler performs the unreachable code analysis for all levels of optimization, including /NOOPTIMIZE or the equivalent -O0 flag. Compaq COBOL for OpenVMS VAX does not have an /OPTIMIZE qualifier.

B.4.2 Program Listing Differences

Some differences appear in program listings depending upon whether they were produced by the Compaq COBOL for OpenVMS VAX compiler, the Compaq COBOL compiler on Windows NT, Tru64 UNIX system, or OpenVMS Alpha systems.

B.4.2.1 Machine Code

With Compaq COBOL, /NOOBJECT and -noobject cause the compiler to suppress code generation, so no machine code is produced either for the listing or for the object module.

With Compaq COBOL for OpenVMS VAX, /NOOBJECT suppresses just the creation of the .OBJ. Compaq COBOL for OpenVMS VAX still does all the work to generate the object code so it can be placed in the listing.

If you want the machine code to be included in the program listing, do not use /NOOBJECT or -noobject .

B.4.2.2 Module Names

With Compaq COBOL, the name of the first program is the module name throughout the compilation. With Compaq COBOL for OpenVMS VAX, the module name changes as the various programs are encountered.

B.4.2.3 COPY and REPLACE Statements

The Compaq COBOL compiler and the Compaq COBOL for OpenVMS VAX compiler produce output in slightly different formats when listing annotations for the COPY statement in COBOL programs.

The following two compiler listing files illustrate the difference in the position of the listing annotations, represented by the letter "L," in a COBOL program using Compaq COBOL and Compaq COBOL for OpenVMS VAX.

Compaq COBOL Listing File for COPY Statement


 
              1 IDENTIFICATION DIVISION. 
              2 PROGRAM-ID. DCOP1B. 
              3 * 
              4 *       This program tests the copy library file. 
              5 *       with a comment in the middle of it. 
              6 *       It should not produce any diagnostics. 
              7         COPY 
              8 *       this is the comment in the middle 
              9                 LCOP1A. 
L            10 ENVIRONMENT DIVISION. 
L            11 INPUT-OUTPUT SECTION. 
L            12 FILE-CONTROL. 
L            13 SELECT FILE-1 
L            14         ASSIGN TO "FILE1.TMP". 
             15 DATA DIVISION. 
             16 FILE SECTION. 
             17 FD      FILE-1. 
             18 01      FILE1-REC       PIC X. 
             19 WORKING-STORAGE SECTION. 
             20 PROCEDURE DIVISION. 
             21 PE.     DISPLAY "***END***" 
             22         STOP RUN. 
 

Compaq COBOL for OpenVMS VAX Listing File for COPY Statement


 
 
    1         IDENTIFICATION DIVISION. 
    2         PROGRAM-ID. DCOP1B. 
    3        * 
    4        *    This program tests the copy library file. 
    5        *    with a comment in the middle of it. 
    6        *    It should not produce any diagnostics. 
    7             COPY 
    8        *    this is the comment in the middle 
    9                     LCOP1A. 
   10L        ENVIRONMENT DIVISION. 
   11L        INPUT-OUTPUT SECTION. 
   12L        FILE-CONTROL. 
   13L        SELECT FILE-1 
   14L            ASSIGN TO "FILE1.TMP". 
   15         DATA DIVISION. 
   16         FILE SECTION. 
   17         FD  FILE-1. 
   18         01  FILE1-REC       PIC X. 
   19         WORKING-STORAGE SECTION. 
   20         PROCEDURE DIVISION. 
   21         PE. DISPLAY "***END***" 
   22             STOP RUN. 
 
 

B.4.2.4 Multiple COPY Statements

The Compaq COBOL and Compaq COBOL for OpenVMS VAX compilers also produce output in slightly different formats when listing a COBOL program with multiple COPY statements on a single line.

The following two compiler listing files illustrate the difference in the position of the listing annotations, represented by the letter "L," for multiple COPY statements on a single line in a COBOL program using Compaq COBOL and Compaq COBOL for OpenVMS VAX.

Compaq COBOL Listing File for Multiple COPY Statements


 
 
              1 IDENTIFICATION DIVISION. 
              2 PROGRAM-ID. DCOP1J. 
              3 * 
              4 *       Tests copy with three copy statements on 1 line. 
              5 * 
              6 ENVIRONMENT DIVISION. 
              7 DATA DIVISION. 
              8 PROCEDURE DIVISION. 
              9 THE. 
             10         COPY LCOP1J. COPY LCOP1J. COPY LCOP1J. 
L            11         DISPLAY "POIUYTREWQ". 
L            12         DISPLAY "POIUYTREWQ". 
L            13         DISPLAY "POIUYTREWQ". 
             14         STOP RUN. 
 
 

Compaq COBOL for OpenVMS VAX Listing File for Multiple COPY Statements


 
 
    1         IDENTIFICATION DIVISION. 
    2         PROGRAM-ID. DCOP1J. 
    3        * 
    4        *    Tests copy with three copy statements on 1 line. 
    5        * 
    6         ENVIRONMENT DIVISION. 
    7         DATA DIVISION. 
    8         PROCEDURE DIVISION. 
    9         THE. 
   10             COPY LCOP1J. 
   11L            DISPLAY "POIUYTREWQ". 
   12C                         COPY LCOP1J. 
   13L            DISPLAY "POIUYTREWQ". 
   14C                                      COPY LCOP1J. 
   15L            DISPLAY "POIUYTREWQ". 
   16             STOP RUN. 
 
 

B.4.2.5 COPY Insert Statement

The compiler listing files for a Compaq COBOL program and a Compaq COBOL for OpenVMS VAX program differ when a COPY statement inserts text in the middle of a line.

In the following two compiler listing files, LCOP5D.LIB contains "O". The Compaq COBOL compiler keeps the same line and inserts the COPY file contents below the source line. The Compaq COBOL for OpenVMS VAX compiler splits the original source line into parts.

Compaq COBOL Listing File for COPY Statement


 
        ----------------------------------------------------------- 
           13 P0.     MOVE COPY LCOP5D. TO ALPHA. 
        L  14              "O" 
 
 

Compaq COBOL for OpenVMS VAX Listing File for COPY Statement


 
        ----------------------------------------------------------- 
        13         P0. MOVE COPY LCOP5D. 
        14L                 "O" 
        15C                              TO ALPHA. 
 
 


Previous Next Contents Index