Compiler limits

The following table lists the 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 999,999 lines
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
DATA RECORD data-name . . . No limit
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
STL file system, maximum records 2,147,483,647 bytes

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

SdU file system, maximum records 2,147,483,647 bytes

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

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

Line-sequential files

  • Maximum record size: 1,048,576 bytes
  • Maximum number of bytes allocated for a file: no maximum

SdU files

  • Minimum record size: 1 byte
  • Maximum record size: 64,000 bytes
  • Maximum record key length: 255 bytes
  • Maximum relative key value: 2**31 -1
  • Maximum number of bytes allocated for a file:
    • If FILEMODE(SMALL) is in effect: 2 GB
    • If FILEMODE(LARGE) is in effect: maximum record size times maximum records

STL files

  • Minimum record size: 1 byte
  • Maximum record size: 1,048,576 bytes
  • Maximum record key length: 255 bytes
  • Maximum number of alternate keys: 253
  • Maximum relative key value: 2**31 -1
  • Maximum number of bytes allocated for a file:
    • If FILEMODE(SMALL) is in effect: 2 GB
    • If FILEMODE(LARGE) is in effect: maximum record size times maximum records

RSD files

  • Fixed-length records only
  • Minimum record size: 1 byte
  • Maximum record size: 1,048,576 bytes
  • Maximum number of bytes allocated for a file: no maximum

DB2 files

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

  • Minimum record size: 0 bytes
  • Maximum row length: 4005 bytes
  • Maximum record size for fixed-length records:
    • Indexed records: 4005 bytes
    • Small-format relative or sequential records: 4001 bytes
    • Large-format relative or sequential records: 3997 bytes

    Because keys must be at a fixed location in an indexed file record, there are separate constraints for indexed files that end with a variable-length data segment.

  • Maximum record size for variable-length records:
    • For VARCHAR columns, the limits are 4 bytes fewer than for fixed-length records, because the data for the VARCHAR type is maintained directly in the row, and is preceded by a 4-byte descriptor.
    • For other variable length types, such as BLOB, only the descriptor is stored in the row. The data is stored separately, and has a maximum size of 2 GB.
  • Maximum number of records for relative and sequential files:
    • For small filemode: 2**32
    • For large filemode: 2**64
  • Maximum number of records or alternate keys: 500
  • Maximum record key value:
    • For small filemode: 2**32 -1
    • For large filemode: 2**64 -1
  • Maximum number of bytes allocated for a file: 64 GB

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 FILEMODE, see FILEMODE in the COBOL for AIX 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.