COMP-X
IBM® COBOL for Linux® on x86 does
not support COMP-X
.
When you use IBM
COBOL for Linux on x86 to compile source code that
contains
COMP-X
, you will
receive the error message in the following example:$ cat tcCompX.cbl
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. TEST-CASE.
000030 ENVIRONMENT DIVISION.
000040 DATA DIVISION.
000050
000060 WORKING-STORAGE SECTION.
000070 01 STU-ID PIC S9(4) COMP-X VALUE ZERO.
$ cob2 -o tcCompX tcCompX.cbl
IBM COBOL for Linux 1.2.0 compile started
0LineID Message code Message text
7 IGYDS1089-S "COMP-X" was invalid. Scanning was resumed at the
next area "A" item, level-number, or the start of
the next clause
-Messages Total Informational Warning Error Severe Terminating
0Printed: 1 1
End of compilation 1, program TEST-CASE, highest severity: Severe.
Return code 12
Change COMP-X
to COMP-5
, and
make corresponding changes to the PICTURE
clause.
You must keep the same allocated storage for the data item.
The following table shows the
COMP-5
storage allocation:
Picture | Storage representation |
---|---|
S9(1) through S9(4) | Binary halfword (2 bytes) |
S9(5) through S9(9) | Binary fullword (4 bytes) |
S9(10) through S9(18) | Binary doubleword (8 bytes) |
9(1) through 9(4) | Binary halfword (2 bytes) |
9(5) through 9(9) | Binary fullword (4 bytes) |
9(10) through 9(18) | Binary doubleword (8 bytes) |