HP 3000 Manuals

Types of Data [ Micro Focus COBOL Compatibility Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL Compatibility Guide

Types of Data 

The treatment of data types by this COBOL system is associated with the
action of the file conversion utility Convert3.  This COBOL system always
allocates the same number of bytes to the item in question but may
redefine its contents when it is converted.  Therefore you must be aware
that if these items are redefined and the program logic expects to find a
certain binary value in the redefinition you may not receive the behavior
you are expecting at run time.  At run time this COBOL system may treat
the ON SIZE ERROR clause differently from the RM/COBOL system.  See the
chapter RM/COBOL Conversion Problem Solving for further details.

The following sections define how this COBOL system treats COMPUTATIONAL
COMPUTATIONAL-1 and COMPUTATIONAL-6 types of data.

COMPUTATIONAL (COMP) Data Types 

This COBOL system treats any COMP data items in your RM/COBOL source
program as the standard Micro Focus COBOL DISPLAY format.  The difference
in the internal representation of such data in the two systems is that
this COBOL system always sets the most significant four bits of each byte
to the value 3 while the RM/COBOL system always sets such bits to the
value 0.

For example under the RM/COBOL system:

     PIC 999 COMP VALUE 123

is held in three bytes as hexadecimal value 01 02 03

while under this COBOL system:

     PIC 999 VALUE 123

is held in three bytes as hexadecimal value 31 32 33.

COMPUTATIONAL-1 (COMP-1) Data Types 

For each data item declared as USAGE COMP-1 in your RM/COBOL source
program regardless of its picture-string this COBOL system allocates a
2-byte signed binary data item.  This data item is capable of holding a
hexadecimal value in the range -32768 to +32767.  That is this COBOL
system treats each RM/COBOL USAGE COMP-1 data item as though it had a
standard Micro Focus COBOL picture-string of S9(4) COMP. See your
Language Reference - Additional Topics for details on the standard Micro
Focus COBOL language.

COMPUTATIONAL-6 (COMP-6) Data Types 

This COBOL system treats any COMP-6 data items in your RM/COBOL source
program as the standard Micro Focus COBOL COMP format.  If as a result of
this less data space is allocated to each item than would be under the
RM/COBOL system this COBOL system pads the space with a byte containing a
zero as shown in the following table: 

          COMP-6 to COMP Conversion 

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|        RM         |        Bytes allocated when        |          Number of bytes           |
|  COMP-6 PICTURE   |     converting to Micro Focus      |      containing leading zeros      |
|      clause       |         COBOL COMP PICTURE         |      required to precede COMP      |
|                   |               clause               |           PICTURE clause           |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
|       9(1)        |                 1                  |                NONE                |
|                   |                                    |                                    |
|       9(1)        |                 1                  |                NONE                |
|                   |                                    |                                    |
|       9(3)        |                 2                  |                NONE                |
|                   |                                    |                                    |
|       9(4)        |                 2                  |                NONE                |
|                   |                                    |                                    |
|       9(5)        |                 3                  |                NONE                |
|                   |                                    |                                    |
|       9(6)        |                 3                  |                NONE                |
|                   |                                    |                                    |
|       9(7)        |                 4                  |                NONE                |
|                   |                                    |                                    |
|       9(8)        |                 4                  |                NONE                |
|                   |                                    |                                    |
|       9(9)        |                 5                  |                NONE                |
|                   |                                    |                                    |
|       9(10)       |                 5                  |                NONE                |
|                   |                                    |                                    |
|       9(11)       |                 5                  |                 1                  |
|                   |                                    |                                    |

|       9(12)       |                 5                  |                 1                  |
|                   |                                    |                                    |
|       9(13)       |                 6                  |                 1                  |
|                   |                                    |                                    |
|       9(14)       |                 6                  |                 1                  |
|                   |                                    |                                    |
|       9(15)       |                 7                  |                 1                  |
|                   |                                    |                                    |
|       9(16)       |                 7                  |                 1                  |
|                   |                                    |                                    |
|       9(17)       |                 8                  |                 1                  |
|                   |                                    |                                    |
|       9(18)       |                 8                  |                 1                  |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

The padding byte precedes the converted field and is therefore included
in any redefinition of group fields which contain the converted field.
However the padding byte would not be included if you redefined only the
converted field.  If you wish to ensure that the padding byte is included
in the redefinition of the converted field you must add a field at a
higher level immediately before the converted field and redefine this new
field instead.



MPE/iX 5.0 Documentation