File resources allocation
Resources are those parts of the system that are required by a job or task, including main storage, devices, the processing unit, programs, files, libraries, and folders. When you write a high-level language program, you should be aware of what resources the system has allocated for each file type.
Normally, the system will perform the allocation whenever a requested operation requires it. For example, the system allocates resources for each file that is used in a program when the file is opened.
To ensure that all of the resources that are needed by a program are available before the program is run, you can use the Allocate Object (ALCOBJ) CL command in the job before you run the program. In particular, the ALCOBJ command can allocate database files and most devices. The following operations are examples of operations that require resource allocation:
- Open
- Acquire
- Start a program on a remote system
- File resource allocation: Overview
When a high-level language program uses a file, several operations require that the system allocate the resources that are needed to perform that operation.
- File resources that must be allocated
The file resources that the system must allocate depend on the type of file and the operation.
- How the system allocates resources
When the system allocates resources, it waits for a predefined time if the resources are not immediately available. If the resources do not become available within the time limit, the system generates an error.
Parent topic:
Working with database files
Related information
Allocate Object (ALCOBJ) command