Language elements

The following table lists language elements that are different between the host COBOL and COBOL for AIX compilers, and where possible offers advice about how to handle such differences in COBOL for AIX programs.

Many COBOL clauses and phrases that are valid in host COBOL are syntax checked but have no effect on the execution of COBOL for AIX programs. These clauses and phrases should have minimal effect on existing applications that you download. COBOL for AIX recognizes most host COBOL language syntax even if that syntax has no functional effect.

Table 1. Language differences between Enterprise COBOL for z/OS and COBOL for AIX
Language element COBOL for AIX implementation or restriction
ACCEPT statement If your host 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 AIX, 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 AIX
ASSIGN clause COBOL for AIX uses a different syntax and mapping to the system file-name based on assignment-name. ASSIGN. . .USING data-name is not supported in host COBOL.
BLOCK CONTAINS clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
CALL statement A file-name as a CALL argument is not supported in COBOL for AIX.
CLOSE statement The following phrases are syntax checked, but have no effect on the execution of the program in COBOL for AIX: 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 AIX
DATA RECORDS clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
DISPLAY statement If your host 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 AIX, environment-name and the associated environment-variable value, if set, determine file identification.
File status data-name-1 Some values and meanings for file status 9x are different in host COBOL than in COBOL for AIX.
File status data-name-8 The format and values are different depending on the platform and the file system.
INDEX data items In host COBOL, INDEX data items are implicitly defined as 4 bytes. In COBOL for AIX programs compiled with ADDR(32), their size is 4 bytes; with ADDR(64), their size is 8 bytes.
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 AIX. 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 AIX. On the AIX workstation, all files are treated as single-volume files.
OBJECT REFERENCE data items In host COBOL, OBJECT REFERENCE data items are implicitly defined as 4 bytes. In COBOL for AIX programs compiled with ADDR(32), their size is 4 bytes; with ADDR(64), their size is 8 bytes.
OPEN statement The following phrases are syntax checked, but have no effect on the execution of the program in COBOL for AIX: REVERSED and WITH NO REWIND.
PASSWORD clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
POINTER, PROCEDURE-POINTER, and FUNCTION-POINTER data items In host COBOL, POINTER and FUNCTION-POINTER data items are implicitly defined as 4 bytes as are the special registers ADDRESS OF and JNIEnvPtr; PROCEDURE-POINTER data items are implicitly defined as 8 bytes. In COBOL for AIX 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 AIX 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 AIX.
RECORDING MODE clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX 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 AIX
RESERVE clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
SAME AREA clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
SAME SORT clause Syntax checked, but has no effect on the execution of the program in COBOL for AIX
SHIFT-IN, SHIFT-OUT special registers The COBOL for AIX 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 AIX. 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 AIX
SORT-MODE-SIZE special register Syntax checked, but has no effect on the execution of the program in COBOL for AIX. 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 AIX
START. . . In COBOL for AIX, 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 AIX multithreaded programs; can be replaced in a multithreaded program with a call to the C exit() function
WRITE statement In COBOL for AIX, if you specify WRITE. . .ADVANCING with environment names C01 through C12 or S01 through S05, one line is advanced.
XML PARSE statement In host 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 AIX.
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.