The following concepts and terminology are used in COBOL for AIX information about files.
File systems usually provide commands to manage files. The following example shows use of the ls command to print details about a file Transaction.log in the STL file system, and shows the system response:
> ls -l Transaction.log -rw-r--r-- 1 cobdev cobdev 6144 May 27 17:29 Transaction.log
In the following example, LOG-FILE is an internal file-name:
Data division. File section. FD LOG-FILE. 01 LOG-FILE-RECORD.
Programs operate on internal files by using I/O statements such as OPEN, CLOSE, READ, WRITE, and START. As the term suggests, an internal file-name has no meaning outside a program.
The ASSIGN clause, described below, is the mechanism that associates an internal file-name with a system file-name.
(An external file-name is distinct from the name of an external file, that is, a file that is defined with the EXTERNAL keyword in its FD entry.)
The ASSIGN clause associates an internal file-name to a system file-name, and is specified in the FILE-CONTROL paragraph. The ASSIGN clause has three basic forms:
SELECT internal-file-name ASSIGN TO user-defined-word
SELECT internal-file-name ASSIGN TO 'literal'
SELECT internal-file-name ASSIGN USING data-name
. . .
MOVE file-information TO data-name
user-defined word and literal each consist of up to three components, separated by hyphens. From left to right:
file-information consists of at most two components, separated by a hyphen. From left to right:
related concepts
File systems
related tasks
Identifying files
related references
ASSIGN clause (COBOL for AIX Language Reference)