Naming the XFD

The compiler needs to give a name to each XFD file (data dictionary) that is built. It attempts to build the name from your COBOL code, although there are some instances where the name in the code is nonspecific, and you must provide a name.

Each XFD name is built from a starting name that is derived (if possible) from the SELECT statement in your COBOL code. The following paragraphs explain how that occurs.

ASSIGN name is a variable

If the SELECT for the file has a variable ASSIGN name (ASSIGN TO filename), then you must specify a starting name for the XFD file via a FILE directive in your code. This process is described inp topics FILE Directive.

ASSIGN name is a constant

If the SELECT for the file has a constant ASSIGN name (such as ASSIGN TO "COMPFILE"), then that name is used as the starting name for the XFD name.

ASSIGN name is generic

If the ASSIGN phrase refers to a generic device (such as ASSIGN TO "DISK"), then the compiler uses the SELECT name as the starting name.

Forming the final XFD name

From the starting name, the final name is formed as follows:

  1. The compiler removes any extensions from the starting name.
  2. It constructs a universal base name by stripping out directory information that fits any of the formats used by the operating systems that run ACUCOBOL-GT.
  3. It converts the base name to lower case.
  4. It appends the letters .xfd to the base name.
Note: The FD can specify the file name using the VALUE OF FILE_ID IS xxx clause. This phrase has a similar effect to the ASSIGN phrase of the SELECT statement, but when this phrase is used it overrides the ASSIGN phrase. So all of the above rules that relate to the ASSIGN phrase also relate to the FILE_ID phrase, when that phrase is used. Technically, the ASSIGN phrase and the FILE_ID phrase are supposed to be identical, but the compiler silently overrrides the ASSIGN with the FILE_ID phrase. See VALUE OF FILE-ID Clausefor more information.