File Status Code Tables |
This chapter gives information on the limits this COBOL system places on the size or number of various parameters relating to file handling.
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.
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.
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 |
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 |
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.
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.
All file organizations OPEN EXCLUSIVE | 2 Gbytes |
All file organizations OPEN SHARED | 1 Gbytes |
UNIX: All file organizations |
2 Gbytes |
All file organizations | No specifiable limit; depends on record size and file size |
IFs (compiled code only) | 255 |
PERFORMs | At least 22 See the section PERFORM Nesting |
CALLs | No specifiable limit |
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 |
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.
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 |
File and record sizes | Limited by operating system environment |
Files open simultaneously | Limited by operating system environment.
DOS: |
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 |
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.
File Status Code Tables |