PreviousFile Status Code Tables

Chapter 32: Limits

This chapter gives information on the limits this COBOL system places on the size or number of various parameters relating to file handling.

32.1 COBOL System Limits

This section lists, by category, the maximum size or number of various parameters used in Micro Focus COBOL. The left-hand column gives the affected parameter, and the right-hand column notes the maximum value allowable in the indicated unit of measure.

There are three levels or categories of limit which must be taken into account for any particular environment: COBOL Compiler limits; COBOL run-time system limits; and external limits.

The COBOL Compiler and the intermediate code that it produces are environment independent. The limits associated with the Compiler are environment independent also and cannot be exceeded in any environment. However, at run time, the operating system or hardware can indirectly affect the design or operation of the COBOL run-time system, thereby imposing limits that are lower than those of the Compiler. In addition, the particular configuration of the operating system or hardware environment might directly impose limits that are lower than those of both the Compiler and the run-time system.

32.1.1 Compiler Limits

The COBOL Compiler and the intermediate code that it produces are environment independent. The limits associated with the Compiler are environment independent also and cannot be exceeded in any environment. Use this table of limits in conjunction with the later two tables of run time and operating system dependent limits which might well be lower than those of the Compiler.

Index keys

Per file (including split-key components) 255 keys
Length of any one key, including split-key 1016 bytes (performance best below 512)
Number of components in a split key 64
Number of alternate keys
 (using COBOL syntax)
 (with Extfh interface)

252
252

SORT/MERGE filename GIVING/USING phrase

16-bit:
Number of files in phrase on the 16-bit COBOL system
 (using default module)
 (using Extsm module)


12
255
32-bit:
Number of files in phrase on 32-bit COBOL systems
 (using default module)
 (using Extsm module)


28
255

32.1.2 Run-time Library and Indirect System Limits

Depending on the operating system or the hardware on which your COBOL application runs, the design and operational limitations of the COBOL run-time system might be lower than those of the Compiler. These limits, which are listed below, should be used in conjunction with the later table of direct operating system limits.

Files open simultaneously

16-bit on DOS and Windows:
Indexed sequential file on the 16-bit COBOL system file system for DOS and Windows

50, or half the number specified by the /f switch
16-bit on OS/2:
Indexed sequential file on the 16-bit COBOL system file system for OS/2

127, or half the number specified by the /f switch
16-bit on DOS and Windows:
All other file organizations on the 16-bit COBOL system for DOS and Windows

100, or the number specified by the /f switch
16-bit on OS/2:
All other file organizations on the 16-bit COBOL system for OS/2

255, or the number specified by the /f switch

16-bit on DOS:
On the 16-bit COBOL system for DOS and Windows, /f must be set to a value less than or equal to 255.

16-bit on OS/2:
On the 16-bit COBOL system for OS/2, /f must be set to a value less than or equal to 65535.

UNIX:
Indexed sequential files on the 32-bit COBOL system for UNIX

128 or half your operating system limit, whichever is the smaller
32-bit :
Sequential files, line sequential files on the 32-bit COBOL system for Windows NT and OS/2 V2

Specified by the environment variable MAX_FILE_HANDLES
Indexed sequential and relative files on the 32-bit COBOL system for Windows NT and OS/2 V2 Half the value specfied by the environment variable MAX_FILE_HANDLES

Note that these maximum figures include any libraries that may be open at the time.

File sizes (bytes)

All file organizations OPEN EXCLUSIVE 2 Gbytes
All file organizations OPEN SHARED 1 Gbytes

UNIX:
All file organizations
2 Gbytes

File sizes (records)

All file organizations No specifiable limit; depends on record size and file size

Index keys (numbers)

Records containing the same duplicate key value in:
 Standard file
 With IDXFORMAT"4" directive


65,535
4,294,967,297
Components in a split key
 (using Micro Focus format file)
 (using C-ISAM format file)

64
8

Nesting

IFs (compiled code only) 255
PERFORMs At least 22
See the section PERFORM Nesting
CALLs No specifiable limit

Record sizes

DOS, Windows and OS/2:
Indexed file, fixed length records
62 Kbytes
UNIX:
Indexed file, fixed length records
32767 bytes
All other file types 62 Kb

Sort keys

16-bit:
Sort key size on the 16-bit COBOL system
 (with RTS)
 (with Extsm)


2999 bytes
4096 bytes
Number of sort keys 36
32-bit:
Sort key size on 32-bit COBOL systems (with RTS or Extsm)

2999  bytes
Number of sort keys 25

32.1.3 Direct System Limits

The limits imposed by the Compiler and the COBOL run-time system are listed in the previous two sections. The operating system or hardware configurations and parameter settings directly impose constraints on your COBOL application. You must check your operating system and hardware to discover the actual values for any limits, but the following table lists typical items that might need to be considered.

Number of

Record locks Operating system dependent
File locks Operating system dependent
Length of contents of DD_ environment variables Up to the maximum operating system size for each path

Items Listed Earlier

File and record sizes Limited by operating system environment
Files open simultaneously Limited by operating system environment.

DOS:
See the appendix Descriptions of Run-time Switches for details on how you can increase this limit on DOS using the /F switch.

Filename size and format Operating system dependent
Index key size and number May be limited if non-standard file handler used
Sort key size and number May be limited if non-standard SORT support routine used

32.1.4 Filenames

A file is identified within a COBOL program by a filename, a user-defined word. Outside the COBOL system it is identified by a filename which must be in an external, operating-system format. DOS, Windows, and OS/2 use the same format; UNIX uses a similar but different format. The DOS format recognizes four components: a drive, a path, a base-name and an extension. The UNIX format recognizes two components: a path and a name.

Micro Focus COBOL imposes a limit of 100 characters on the size of an external filename. COBOL imposes no other limits, but in order for the operating system to handle the filename correctly, any operating system limits must be observed at run time. Some operating systems allow filenames to exceed 100 characters, but such filenames cannot be directly used by a COBOL application.

In the UNIX environment, it is often found convenient to adopt a convention for constructing names for files that simulates the DOS base-name and extension format. It is a convention that a COBOL application can use or ignore. The utilities of the COBOL system use such a convention when they run, and the library routines CBL_SPLIT_FILENAME and CBL_JOIN_FILENAME also support the convention which has been designed to ease portability of applications between DOS, Windows, OS/2 and UNIX (see the chapter File Naming for details). The convention splits a filename into three components: a path, a base-name and an extension.

16-bit:
For the DOS file format used by the 16-bit COBOL system, the path is considered to include the drive. The limits assumed by the convention are:

and 8 characters for the base-name and 3 characters for the extension.

32-bit:
For the file format used by the 32-bit COBOL system for UNIX, Windows NT and OS/2 V2, the limits are 100 characters for the path, 100 characters for the base-name and 100 characters for the extension.

These COBOL limits will be subject to any lower operating system limits that may be in effect. See your operating system documentation for details.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousFile Status Code Tables