ContentsIndexPreviousNext

7.3.5 File Directive

The FILE directive supplies a starting name from which the data dictionary file name is formed. This directive is required only when the file name in the COBOL code is nonspecific. For example, you would use this directive when the SELECT for the file has a variable ASSIGN name (ASSIGN TO variable_name). In this situation, the interface cannot form a file name automatically, and you must provide a name.

A starting name is simply a short file name that serves as the basis for the dictionary name.

Syntax

$XFD FILE=name
  or
*(( XFD FILE=name ))

This directive must appear on the line immediately preceding the file's FD.

Example

Suppose your SELECT statement has a variable ASSIGN name such as the one shown here:

select my-file
     assign to my-variable.

Then you would need to add the FILE directive as shown here:

 select my-file
      assign to my-variable.
      .
      .
      .
$xfd  file=payroll
     fd my-file

Note that this directive must appear immediately before the file's FD.