HP 3000 Manuals

Changed Features [ HP COBOL II/XL Migration Guide ] MPE/iX 5.0 Documentation


HP COBOL II/XL Migration Guide

Changed Features 

This section lists COBOL II/XL features that have changed from COBOL
II/V. For more information on these changes and required program
conversions, refer to the section "Conversion of Changed Features" in
Chapter 3.  It describes the changes in the same order as they are listed
here.

   1.  Index data items are 32 bits (4 bytes) long on MPE XL systems.  On
       MPE V systems, they are 16 bits (2 bytes) long.

   2.  On MPE XL systems, data alignment varies according to the position
       of the item in the source program.  In the WORKING-STORAGE and
       FILE sections, level 01, 77, COMP or BINARY SYNCHRONIZED data
       items and INDEX data items are aligned on 32-bit boundaries.  In
       the LINKAGE section, all data items are aligned on 8-bit (byte)
       boundaries even if the SYNCHRONIZED clause is specified.  On MPE V
       systems, data items are aligned on 16-bit boundaries.

   3.  The format and content of output that the compiler generates as a
       result of the $CONTROL MAP, $CONTROL CODE, and $CONTROL VERBS
       directives are different on MPE XL systems.

   4.  COBOL II/XL no longer removes hyphens embedded in literals used on
       the PROGRAM-ID paragraph or on the ENTRY and CALL statements.  It
       changes the hyphens to underscores.

   5.  COBOL II/XL uses the first 30 characters of external names and
       ignores any additional characters.  COBOL II/V uses the first 15
       characters for subprograms and the first 12 characters for main
       programs.

   6.  All external names (except intrinsics) are converted to lowercase
       unless you begin the name with a backslash.

   7.  The GIVING identifier of the pseudo-intrinsic .LOC. should be
       defined either as PIC S9(9) or PIC S9(18) in HP COBOL II/XL
       instead of PIC S9(4).

   8.  The MPE V commands (COBOLII, COBOLIIPREP, COBOLIIGO, COBOL,
       COBOLPREP and COBOLGO) do not operate for the COBOL II/XL
       compiler.  New commands are provided for the COBOL II/XL compiler.

   9.  All calls to HP system intrinsics, with the exception of
       VPLUS/TurboImage CALLS, must include the keyword INTRINSIC in the
       CALL statement.

  10.  The performance when referencing table elements using subscripts
       defined as

            PIC S9(9) COMP SYNC

       is the same as referencing table elements using index items in
       COBOL II/XL. In COBOL II/V, performance is improved by referencing
       table elements using indexes as opposed to using subscripts.  In
       COBOL II/XL, indexes and subscripts (as specified above) are
       implemented similarly.

  11.  On MPE V systems, numeric display and packed-decimal data are
       checked for validity, by default.  On MPE XL systems, no validity
       checking of this data takes place, by default.  HP COBOL II/XL
       programs cannot be expected to execute the same way with illegal
       or incompatible data values, that is, when the value of a data
       item does not match its picture clause.

  12.  COBOL II/XL object programs compiled with the $CONTROL VALIDATE
       and BOUNDS options abort, by default, when an illegal ASCII or
       decimal digit is encountered during a validity check or when
       division by zero or an overflow condition occurs and there is no
       ON SIZE ERROR clause.  Using the $CONTROL options previously
       described in "Error Handling Options," you can change the default
       action.  COBOL II/V attempts to fix the illegal data and if it is
       fixable continues the program.

  13.  Data items described as 32-bit COMP (or BINARY) without the
       SYNCHRONIZED clause may or may not be aligned on 32-bit
       boundaries.  Passing misaligned data items to subprograms that
       expect aligned parameters will cause run-time errors.

  14.  When adding two items defined as S9(18) or S9(9) COMP (or BINARY)
       COBOL II/XL may trap with integer overflow unless an ON SIZE ERROR
       clause is included.  (Refer to "Error Handling Options" in this
       chapter for more information on how to handle errors in COBOL
       II/XL.)

  15.  The commercial at sign (@) preceding an identifier in the USING
       phrase of the CALL statement is ignored.

  16.  Uninitialized data items used in calculations have always produced
       unpredictable results on MPE V systems and continue to do so on
       MPE XL systems.

       _________________________________________________________________ 

       NOTE  You must initialize all data items used in calculations. 

       _________________________________________________________________ 

  17.  Truncation of BINARY and COMPUTATIONAL result fields (in
       arithmetic operations) is different on MPE XL systems.

  18.  Overlapping table MOVEs initialize only the first element.  In the
       following example, only the first element of TABLE2 (NUM) is
       initialized with the value in the sending field NUM-FIELD.

                   01  TABLE1.
                       05  NUM-FIELD     PIC S9(9) COMP VALUE ZERO.
                       05  ALPHA-FIELD   PIC X          VALUE SPACES.
                       05  TABLE2.
                           10  TABLEOCC  OCCURS 5 TIMES.
                               15  NUM   PIC S9(9) COMP.
                               15  ALP   PIC X.
                                    .
                                    .
                   PROCEDURE DIVISION.
                                    .
                                    .
                       MOVE TABLE1 TO TABLE2.



MPE/iX 5.0 Documentation