HP 3000 Manuals

Problems Producing Executable Code [ COBOL/HP-UX Compatibility Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Compatibility Guide for the Series 700 and 800

Problems Producing Executable Code 

The following sections detail the known problems you may experience when
you submit RM/COBOL source programs to this COBOL system to produce
executable code.  Hints on how you can solve these problems are also
given.

Length of Nonnumeric Literals 

The RM/COBOL system allows you to write source programs containing
nonnumeric literals in the Procedure Division that are up to 2047
characters long.  However, this COBOL system will only accept nonnumeric
literals within the Procedure Division that are up to 160 characters
long, as specified in the ANSI X3.23-1985 COBOL standard.

Solution 

Amend your source program by creating a new data item in the
Working-Storage section, and assigning the literal to the VALUE clause.
If you then use the data item in the Procedure Division in the place of
the original long literal, this COBOL system will accept your source
program.

Example 

The RM/COBOL system accepts the following line of code but this COBOL
system does not:

     MOVE "ABC...AA" TO SCREEN-BUFFER.

where:  ABC...AA represents a literal of 1500 characters.

Change the code to:

     MOVE LONG-LITERAL-1 TO SCREEN-BUFFER.

Define a new item in the Working-Storage section of your source program:

     01 LONG-LITERAL-1  PIC X(1500) VALUE "ABC...AA".

You can now submit your amended RM/COBOL source program to this COBOL
system and it will be accepted successfully.

Source Code in Columns 73 to 80 

This COBOL system ignores any of the code within your source programs
which lies within columns 73-80 inclusive.

Solution 

The illegal COBOL code has probably resulted from expanding TAB
characters in your source program to standard TAB stops.  If your source
program contains TAB stops, run the tabx program before submitting your
source program to this COBOL system.  This expands TAB characters into a
form which is acceptable to this COBOL system.  See Chapter 5  for
details on the tabx program.

Reserved Words 

When you set system directives, such as MF or ANS85, this activates
various features and their associated reserved words within the VS COBOL
language.  As a result, you may receive errors when you submit source
programs to this COBOL system with such directives set, because data
items within them have the same name as words which are defined as
reserved words.

Solution 

Edit your source programs to rename the offending data item(s), or use
the REMOVE system directive to remove a specified reserved word from the
reserved word list.  See your COBOL System Reference for details of the
REMOVE directive.

Example 

Your RM/COBOL source program may contain the following lines of code:

     ....
     03 SORT   PIC 99.
     ....
     MOVE 1 TO SORT

If you submit this to this COBOL system you will receive an error as this
system supports the SORT verb, while the RM/COBOL system does not.
However, if you specify the SORT parameter with the REMOVE directive when
you submit this source program to this COBOL system, you will receive no
errors. 

Numbering of Segments 

The RM/COBOL system allows you to specify segment numbers greater than
99.  However, this COBOL system conforms to segment number limit
specified in the ANS X3.23-1985 COBOL standard, and allows you to specify
segment numbers only in the range 0 to 99 inclusive.

Solution 

Recode your source programs so that segment numbers greater than 99 are
less than or equal to 99.  Make sure that any new segment numbers you
allocate do not clash with an already existing segment number.  Note that
segment numbers between 0 and 49, inclusive, are used by this COBOL
system to indicate fixed portions of your object program, while segment
numbers 50 to 99, inclusive, indicate independent segments.  For details
on the use of segmentation and segment numbers in your source programs,
see your Language Reference.

Program Identification and Data Names 

The RM/COBOL system allows the name given in the PROGRAM-ID phrase and a
data item in that program to be the same.  However, this COBOL system
does not allow the use of the same name for the PROGRAM-ID and a data
item in the program, and requires instead that each should be unique.

Solution 

Change either the program name in the PROGRAM-ID phrase, or the name of
the data item, so that you follow the conventions of VS COBOL as given in
your Language Reference.

Duplicate Paragraph Names 

If your program contains duplicate paragraph names, both COBOL systems
will resolve references to the duplicate paragraph names in the same way,
provided the duplicate paragraph names are only referenced from within
the sections in which they are declared.  If, however, you reference a
duplicate paragraph name from a different section to the one it is
declared in, the RM/COBOL system will assume that the reference is to the
next declaration of the duplicate paragraph name, whereas this COBOL
system will give an error when you are producing intermediate code.

Solution 

To ensure that references to duplicate paragraph names are correctly
resolved, you must qualify a reference to a duplicate paragraph name by
adding the section name in which it is declared.

Example 

If your source code contains the following:

          ....
          PERFORM para-2.
          ....
     sect-1 SECTION.
          para-1.
          ....
          para-2.
          ....
     sect-2 SECTION.
          para-2.
          ....

the RM/COBOL system will resolve the reference to para-2 in the PERFORM
statement by using the declaration of para-2 in the sect-1 SECTION. Under
this COBOL system, however, you must qualify the reference to the
duplicate paragraph name in your source code by using the PERFORM para-2
OF sect-1 statement.



MPE/iX 5.0 Documentation