FILE Directive

The FILE directive supplies a starting name from which the XFD 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 XFD name.

Syntax

$XFD FILE=name

or

*(( XFD FILE=name ))

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

Special characters (such as $) can be included within the filename if the name is surrounded by either single or double quotes. For example:

$XFD FILE="f$test"

No quotes are required if the filename does not include special characters.

Example

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

select my-file
  assign to my-variable.

You would need to add the FILE directive as shown here:

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