COBOL Manual for TNS and TNS/R Programs

Disk Input and Output
HP COBOL Manual for TNS and TNS/R Programs522555-006
28-9
Modification
If you want to do mixed-language programming, compiling your program to run in the
CRE is highly recommended. Although mixed-language programming is possible in the
non-CRE environment, it is very limited because of incompatibilities between different
languages’ run-time libraries. The CRE supports the languages HP C, HP COBOL,
FORTRAN, Pascal, and TAL. For more information about the CRE in general and on
mixed-language programs sharing standard files in particular, see the CRE
Programmers Guide.
Modification
With the ENABLE utility, you can build a file-maintenance application that allows you to
modify a disk file. ENABLE uses a Data Definition Language (DDL) file description to
create a Pathway application that you can use to read and change the data in the disk
file. For details, see the ENABLE Users Guide.
Maximum Number of Files
The maximum number of files on a volume is determined during system configuration.
The maximum number of files that a single process can have open concurrently
depends on the amount of space available for file control blocks and buffers in the
upper 64 KB of the process’s user data space.
Types of HP Disk Files
NonStop systems provide two types of disk files:
Unstructured (Sequential) Files
Structured Files
Unstructured (Sequential) Files
An unstructured file consists of a stream of bytes, and Enscribe allows each byte to be
addressed directly. The organization of an unstructured file is the responsibility of the
program that uses it. An HP COBOL program can only use an unstructured file as a
sequential file.
Two examples of unstructured files are object code files (file code 100) and EDIT files
(file code 101).
An EDIT file can have variable-length records, but all other unstructured files must
have fixed-length records. No unstructured file can have alternate record keys.
A program written entirely in HP COBOL can open an EDIT file for both input and
output (or extension). The HP COBOL program cannot access the line numbers of the
EDIT file, only the text of the lines themselves.