contents.gifindex.gifprev1.gifnext1.gif

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, use this directive when the SELECT for the file has a variable ASSIGN name (ASSIGN TO variable_name). In this case, the interface cannot form a file name automatically, and you must provide a name. The starting name 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.

See also

XFD-MAP