HP OpenVMS Systems Documentation

Content starts here

HP COBOL
User Manual


Previous Contents Index

B.4.2.5 COPY Insert Statement

The compiler listing file for an HP COBOL program differs on Alpha and I64 from VAX when a COPY statement inserts text in the middle of a line.

In the following two compiler listing files, LCOP5D.LIB contains "O". The HP COBOL on Alpha and I64 compiler keeps the same line and inserts the COPY file contents below the source line. On VAX, the compiler splits the original source line into parts.

HP COBOL on Alpha and I64 Listing File for COPY Statement



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


HP COBOL on VAX Listing File for COPY Statement



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


B.4.2.6 REPLACE and COPY REPLACING Statements

For the REPLACE and COPY REPLACING statements, the line numbers in compiler listing files differ between Alpha and I64 listing files and VAX listing files. HP COBOL on Alpha and I64 arranges the line number for the replacement line to correspond to its line number in the original source text, while subsequent line numbers differ. HP COBOL for OpenVMS VAX arranges the line numbers consecutively.

The following source program produces compiler listing files with different ending line numbers on Alpha and I64 and VAX:

Source File



                REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
                A
                VERY
                LONG
                STATEMENT.
                DISPLAY "To REPLACE or not to REPLACE".

HP COBOL on Alpha and I64 Listing File for REPLACE Statement




        -----------------------------------------------------------------
                1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
                2 EXIT PROGRAM.
                6 DISPLAY "To REPLACE or not to REPLACE".

HP COBOL on VAX Listing File for REPLACE Statement




        -----------------------------------------------------------------
                1 REPLACE ==A VERY LONG STATEMENT== by ==EXIT PROGRAM==.
                2 EXIT PROGRAM.
                3 DISPLAY "To REPLACE or not to REPLACE".

The diagnostic messages for the COBOL source statements REPLACE and DATE-COMPILED result in compiler listing files that contain multiple instances of the source line.

On Alpha and I64, for a REPLACE statement in an HP COBOL program, if the compiler issues a message on the replacement text, the message corresponds to the original text in the program, as shown in the following:

HP COBOL on Alpha and I64 Listing File for REPLACE Statement




                     18 P0.     REPLACE ==xyzpdqnothere==
                     19                         BY ==nothere==.
                     20
                     21         copy "drep3hlib".
        L            22         display xyzpdqnothere.
                     ...................1
             %COBOL-F-UNDEFSYM, (1) Undefined name

        LR           22     display nothere.

On VAX, the compiler message corresponds to the replacement text, as shown in the following:

HP COBOL on VAX Listing File for REPLACE Statement




        18         P0. REPLACE ==xyzpdqnothere==
        19                             BY ==nothere==.
        20
        21             copy "drep3hlib".
        22LR           display nothere.
                               1
             %COBOL-F-ERROR  349, (1) Undefined name

B.4.2.7 DATE COMPILED Statement

The following two compiler listing files demonstrate the difference between using the DATE-COMPILED statement with HP COBOL on Alpha or I64 and VAX.

HP COBOL on Alpha and I64 Listing File for DATE-COMPILED Statement



             33 *
             34 date-compiled
                .............1
%COBOL-E-NODOT, (1) Missing period is assumed

             34 date-compiled  16-Jul-1992.
             35 security. none.

HP COBOL on VAX Listing File for DATE-COMPILED Statement



   33        *
   34         date-compiled   16-Jul-1992.
                           1
%COBOL-E-ERROR   65, (1) Missing period is assumed
   35         security. none.

B.4.2.8 Compiler Listings and Separate Compilations (OpenVMS)

On OpenVMS Alpha and I64, the /SEPARATE_COMPILATION qualifier produces distinct listings. For separately compiled programs (SCP) compiled without /SEPARATE_COMPILATION, the listings are ordered as follows:

  • PROGRAM_1 source listing
  • PROGRAM_2 source listing
  • PROGRAM_3 source listing
  • PROGRAM_1 machine code listing
  • PROGRAM_2 machine code listing
  • PROGRAM_3 machine code listing

With /SEPARATE_COMPILATION, the listings are ordered as follows (consistent with the order on VAX):

  • PROGRAM_1 source listing
  • PROGRAM_1 machine code listing
  • PROGRAM_2 source listing
  • PROGRAM_2 machine code listing
  • PROGRAM_3 source listing
  • PROGRAM_3 machine code listing

B.4.3 Output Formatting

Control Byte Sequences

HP COBOL on Alpha and I64 and HP COBOL on VAX may use different control byte sequences in VFC files to accomplish similar output file formatting.

VFC Files

VFC formatted REPORT WRITER or LINAGE files are normally viewed by using the TYPE command or by printing them out. If you need to mail reports through electronic mail or to bring them up in an editor, you can do so by compiling with /NOVFC on the compile command line.

All REPORT WRITER and LINAGE files that are opened in a single .COB source file will have the same format (either VFC or NOVFC). VFC is the default. For example:


   $ COBOL A/NOVFC,B/VFC,C/NOVFC,D

In this example, source files B and D will produce reports in VFC format. (Behavior is different when the source file list items are separated by plus (+) signs. See Section 1.2.2.1, Format of the COBOL Command on OpenVMS.)

On Tru64 UNIX, the REPORT WRITER and LINAGE files produce ASCII file output, which can be viewed or mailed electronically.

B.4.4 HP COBOL Statement Differences on Alpha, I64, and VAX

The following COBOL statements and clause behave differently on Alpha and I64 than they do onVAX:

  • ACCEPT
  • DISPLAY
  • EXIT PROGRAM
  • LINAGE clause
  • MOVE
  • SEARCH

B.4.4.1 ACCEPT and DISPLAY Statements

When you use any extended feature of ACCEPT or DISPLAY within your program, visible differences in behavior between HP COBOL on Alpha and I64 and VAX exist in some instances. The Alpha and I64 behavior in these instances is as follows:

  • When you mix ANSI ACCEPT statements and extended ACCEPT statements in a program, the editing keys used by the extended ACCEPT statements are also used by the ANSI ACCEPT statements. (See Table 11-3 for a complete list of editing keys.)
  • When your terminal is set to no-wrap mode and you display an item whose characters extend past the edge of the screen, all characters past the rightmost column are truncated. For example, if you specify a display of "1234" at column 79 on an 80-column screen, HP COBOL on Alpha and I64 will display 12. By contrast, HP COBOL on VAX overstrikes the character in the rightmost column and displays 14.
  • If your application uses the HP extensions to the ACCEPT or DISPLAY statements, HP COBOL on Alpha and I64 positions the cursor in the upper left corner of the screen prior to the execution of the first ACCEPT or DISPLAY statement.
    This difference is clearly shown when the first ACCEPT or DISPLAY statement does not contain the LINE and COLUMN clauses. In this case HP COBOL on Alpha and I64 moves the cursor to the top of the screen to perform the ACCEPT or DISPLAY, whereas HP COBOL on VAX does not move the cursor.

Screen update behavior is not identical for HP COBOL on Alpha and I64 and HP COBOL on VAX, and they sometimes use different escape sequences for ACCEPT and DISPLAY to accomplish similar screen formatting.


Previous Next Contents Index