Language elements
The following table lists language elements that are different between Enterprise COBOL and COBOL for Linux® on x86 compilers, and where possible offers advice about how to handle such differences in COBOL for Linux on x86 programs.
Many COBOL clauses and phrases that are valid in Enterprise COBOL are syntax checked but have no effect on the execution of COBOL for Linux on x86 programs. These clauses and phrases should have minimal effect on existing applications that you download. COBOL for Linux on x86 recognizes most Enterprise COBOL language syntax even if that syntax has no functional effect.
Language element | COBOL for Linux on x86 implementation or restriction |
---|---|
ACCEPT statement |
If your Enterprise COBOL program expects ddnames as the targets of
ACCEPT statements, define these targets by using equivalent environment variables
with values set to appropriate file-names. In COBOL for Linux on x86, environment-name
and the associated environment-variable value, if set, determine file identification. |
APPLY WRITE-ONLY clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
ASSIGN clause |
COBOL for Linux on x86 uses a
different syntax and mapping to the system file-name based on assignment-name.
ASSIGN. . .USING
data-name is not supported in Enterprise COBOL. |
BLOCK CONTAINS clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
CALL statement |
A file-name as a CALL argument is not supported in COBOL for Linux on x86. |
CLOSE statement |
The following phrases are syntax checked, but have no effect on the execution of
the program in COBOL for Linux on x86: FOR
REMOVAL , WITH NO REWIND , and UNIT/REEL . Avoid use of
these phrases in programs that are intended to be portable. |
CODE-SET clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
DATA RECORDS clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
DISPLAY statement |
If your Enterprise COBOL program expects ddnames as the targets of
DISPLAY statements, define these targets by using equivalent environment variables
with values set to appropriate file-names. In COBOL for Linux on x86, environment-name
and the associated environment-variable value, if set, determine file identification. |
DYNAMIC LENGTH clause |
Dynamic-length elementary items are not currently supported in COBOL for Linux on x86. |
File status data-name-1 | Some values and meanings for file status 9x are different in Enterprise COBOL than in COBOL for Linux on x86. |
File status data-name-8 | The format and values are different depending on the platform and the file system. |
INDEX data items |
In Enterprise COBOL, INDEX data items are implicitly defined as
4 bytes. In COBOL for Linux on x86 programs compiled
with ADDR(32) , their size is 4 bytes; with ADDR(64) , their size is
8 bytes. |
INVOKE statement |
COBOL for Linux on x86 does not support writing object-oriented programs, creating object instances of a COBOL or Java™ class or invoking a method defined in a COBOL or Java class. |
JSON GENERATE and JSON PARSE
statements |
JSON is not currently supported in COBOL for Linux on x86. |
LABEL RECORDS clause |
The phrases LABEL RECORD IS
data-name, USE. . .AFTER. . .LABEL PROCEDURE , and GO TO
MORE-LABELS are syntax checked, but have no effect on the execution of the program in
COBOL for Linux on x86. A warning is
issued if you use any of these phrases. The user-label declaratives are not called at run time. You cannot port programs that depend on the user-label processing that z/OS® QSAM supports. |
MULTIPLE FILE TAPE |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86. On the Linux workstation, all files are treated as single-volume files. |
OBJECT REFERENCE data items |
OBJECT REFERENCE data items are not supported in COBOL for Linux on x86. |
OPEN statement |
The following phrases are syntax checked, but have no effect on the execution of
the program in COBOL for Linux on x86:
REVERSED and WITH NO REWIND . |
PASSWORD clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
POINTER , PROCEDURE-POINTER , and
FUNCTION-POINTER data items |
In Enterprise COBOL, POINTER and
FUNCTION-POINTER data items are implicitly defined as 4 bytes as is the special register
ADDRESS OF ;
PROCEDURE-POINTER data items are implicitly defined as 8 bytes. In COBOL for Linux on x86 programs compiled with
ADDR(32) , the size of each of these items is 4 bytes; with
ADDR(64) , their size is 8 bytes. |
READ. . .PREVIOUS |
In COBOL for Linux on x86 only,
allows you to read the previous record for relative or indexed files with DYNAMIC
access mode |
RECORD CONTAINS clause |
The RECORD CONTAINS
n
CHARACTERS clause is accepted with one exception: RECORD CONTAINS 0
CHARACTERS is syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86. |
RECORDING MODE clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 for relative, indexed, and
line-sequential files. RECORDING MODE U is syntax checked, but has no effect on the
execution of the program for sequential files. |
RERUN clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
RESERVE clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
SAME AREA clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
SAME SORT clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
SHIFT-IN , SHIFT-OUT special registers |
The COBOL for Linux on x86
compiler puts out an E-level message if it encounters these registers unless the
CHAR(EBCDIC) compiler option is in effect. |
SORT-CONTROL special register |
The implicit definition and contents of this special register differ between host and workstation COBOL. |
SORT-CORE-SIZE special register |
The contents of this special register differ between host and workstation COBOL. |
SORT-FILE-SIZE special register |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86. Values in this special register are not used. |
SORT-MESSAGE special register |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
SORT-MODE-SIZE special register |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86. Values in this special register are not used. |
SORT MERGE AREA clause |
Syntax checked, but has no effect on the execution of the program in COBOL for Linux on x86 |
START . . . |
In COBOL for Linux on x86, the
following relational operators are allowed: IS LESS THAN , IS < ,
IS NOT GREATER THAN , IS NOT > , IS LESS THAN OR EQUAL
TO , IS <= . |
STOP RUN |
Not supported in COBOL for Linux on x86 multithreaded programs; can be replaced in a multithreaded program with a call to the C exit() function |
UTF-8 phrase of the USAGE clause and the 'U' PICTURE
symbol |
The UTF-8 data class and UTF-8 data category are not currently supported in COBOL for Linux on x86. |
WRITE statement |
In COBOL for Linux on x86, if
you specify WRITE. . .ADVANCING with environment names C01 through
C12 or S01 through S05 , one line is
advanced. |
XML PARSE statement |
In Enterprise COBOL programs compiled using the host-only option
XMLPARSE(XMLSS) , additional syntax (the ENCODING phrase and
RETURNING NATIONAL phrase) and special registers for namespace processing are
available that are not available with COBOL for Linux on x86. |
Names known to the platform environment | The following names are identified differently: program-name, text-name,
library-name, assignment-name, file-name in the SORT-CONTROL special register,
basis-name, DISPLAY or ACCEPT target identification, and
system-dependent names. |