Compiler limits

COBOL for AIX supports various compiler limits for programs and class definitions.

Table 1. Compiler limits
Language element Compiler limit
Maximum length of user-defined words (for example, data-name, file-name, class-name) 30 bytes
Size of program Start of change With NOTEST: 999,999 lines End of change

Start of change With TEST in 32-bit mode: 65,535 lines End of change

Start of change With TEST in 64-bit mode: 2,147,483,647 lines End of change

Number of literals 4,194,303
Total length of literals 4,194,303 bytes
Reserved word table entries 1536
COPY REPLACING . . . BY . . . (items per COPY statement) No limit
Number of COPY libraries No limit
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
Configuration section
Special-names paragraph
mnemonic-name IS 18
UPSI-n . . . (switches) 0-7
alphabet-name IS . . . No limit
Literal THRU . . . or ALSO . . . 256
Input-Output section
File-control paragraph
SELECT file-name . . . A maximum of 65,535 file names can be assigned external names
ASSIGN system-name . . . No limit
RECORD KEY length No limit
RESERVE integer (buffers) 255
I-O-control paragraph
RERUN ON system-name . . . 32,767
RERUN integer RECORDS 16,777,215
SAME RECORD AREA 255
SAME RECORD AREA FOR file-name . . . 255
SAME SORT/MERGE AREA No limit
MULTIPLE FILE file-name . . . No limit
DATA DIVISION
77 data item size With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

01-49 data item size With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

Total 01 + 77 (data items) No limit
88 condition-names . . . No limit
VALUE literal . . . No limit
66 RENAMES . . . No limit
PICTURE clause, number of characters in character-string 50
PICTURE clause, numeric item digit positions With ARITH(COMPAT): 18

With ARITH(EXTEND): 31

PICTURE clause, numeric-edited character positions 249
Picture symbol replication ( ) With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

Picture symbol replication (editing) 32,767
Picture symbol replication ( ), class DBCS items With ADDR(32): 499,999,999 bytes

With ADDR(64): 1,073,741,823 bytes

Picture symbol replication ( ), class national items With ADDR(32): 499,999,999 bytes

With ADDR(64): 1,073,741,823 bytes

Elementary item size With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

OCCURS integer With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

Total number of ODOs 4,194,303
Table size With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

Table element size With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

ASCENDING or DESCENDING KEY . . . (per OCCURS clause) 12 KEYS
Total length of keys (per OCCURS clause) 256 bytes
INDEXED BY . . . (index names per OCCURS clause) 12
Total number of indexes (index names) per class or program 65,535
Size of relative index 32,765
FILE SECTION
FD record description entry 1,048,576 bytes

For more information on size limits, see File input-output limitations.

FD file-name . . . 65,535
LABEL data-name . . . (if no optional clauses) 255
Label record length 80 bytes
BLOCK CONTAINS integer 2,147,483,647 bytes
RECORD CONTAINS integer 1,048,576 bytes

For more information on size limits, see File input-output limitations.

LINAGE clause values 99,999,999
SD file-name . . . 65,535
DATA RECORD data-name . . . No limit
LINKAGE SECTION
Total size With ADDR(32): 2,147,483,646 bytes

With ADDR(64): Unlimited, up to the available 64-bit addressing capacity of the machine.

LOCAL-STORAGE SECTION
Total size With ADDR(32): 2,147,483,646 bytes

With ADDR(64): Unlimited, up to the available 64-bit addressing capacity of the machine.

WORKING-STORAGE SECTION
Total size of items without the external attribute With ADDR(32): 2,147,483,646 bytes

With ADDR(64): Unlimited, up to the available 64-bit addressing capacity of the machine.

Total size of items with the external attribute With ADDR(32): 2,147,483,646 bytes

With ADDR(64): Unlimited, up to the available 64-bit addressing capacity of the machine.

PROCEDURE DIVISION
PROCEDURE DIVISION USING identifier . . . 32,767
Procedure-names 1,048,575
Subscripted data-names per statement 32,767
Verbs per line (TEST) 7
ADD identifier . . . No limit
ALTER procedure-name-1 TO procedure-name-2 . . . 4,194,303
CALL . . . BY CONTENT identifier With ADDR(32): 2,147,483,647 bytes

With ADDR(64): Unlimited, up to the available 64-bit addressing capacity of the machine.

CALL identifier or literal USING identifier or literal . . . 500
CALL literal . . . 4,194,303
Active programs in a run unit 32,767
Number of names called (DYN option) No limit
CANCEL identifier or literal . . . No limit
CLOSE file-name . . . No limit
COMPUTE identifier . . . No limit
DISPLAY identifier or literal  . . . No limit
DIVIDE identifier . . . No limit
ENTRY USING identifier or literal . . . No limit
EVALUATE . . . subjects 64
EVALUATE . . . WHEN clauses 256
GO procedure-name . . . DEPENDING 255
INSPECT TALLYING and REPLACING clauses No limit
MERGE file-name ASC or DES KEY . . . No limit
Total merge key length 4,092 bytes
MERGE USING file-name . . . 16
MOVE identifier or literal TO identifier . . . No limit
MULTIPLY identifier . . . No limit
OPEN file-name . . . No limit
PERFORM 4,194,303
PERFORM . . . TIMES identifier or literal 999,999,999
SEARCH . . . WHEN . . . No limit
SET index or identifier . . . TO No limit
SET index . . . UP/DOWN No limit
SORT file-name ASC or DES KEY No limit
Total sort key length 4,092 bytes
SORT USING file-name . . . 16
STRING identifier . . . No limit
STRING DELIMITED identifier or literal . . . No limit
UNSTRING DELIMITED identifier or literal  . . . 255
UNSTRING INTO identifier or literal . . . No limit
USE . . . ON file-name . . . No limit
XML PARSE statement, maximum size of identifier With ADDR(32): 999,999,999 bytes

With ADDR(64): 2,147,483,646 bytes

File input-output limitations

Beginning with version 4.1.1 of COBOL for AIX, you can no longer indicate that a COBOL for AIX program should create small or large-format files. Instead, by default, COBOL for AIX version 4.1.1 or later programs will ignore the FILEMODE option and create large-format files.

For compatibility with COBOL for AIX Version 2, Version 3 and Version 4.1, you can read files created in small-format.

This section lists file input-output limitations for different types of files.

Line-sequential files

SFS files

SdU files

STL files

RSD files

QSAM files
  • Maximum record size:
    • Fixed-length records: 2**64
    • Variable-length records: 2**16 -4
  • Maximum number of records: no maximum
  • Maximum record key value: 2**64
  • Maximum number of bytes allocated for a file: 2**64

DB2® files

The limitations listed below assume simple tables and the default 4 KB database page size.

For information about the limits of DB2 files, see SQL and XML limits in the DB2 for Linux, UNIX, and Windows, Database Administration Concepts and Configuration Reference.

For information about the limits of Encina SFS files, see the TXSeries® for Multiplatforms: CICS® Application Programming Guide.

For information about ARITH, see ARITH in the COBOL for AIX Programming Guide.

For information about ADDR, see ADDR in the COBOL for AIX Programming Guide.