File Control Description (FCD)

The File Control Description (FCD) is a data area which contains information about the file in use. There are two versions of the FCD, and which one is used depends on whether your COBOL development environment is running in 32-bit or 64-bit, as shown in the following table:

COBOL Development System FCD Used
Visual COBOL FCD3
Mainframe Express FCD2
32-bit Enterprise Developer FCD3
64-bit Enterprise Developer FCD3
JVM COBOL support within Enterprise Developer FCD3
32-bit Server Express FCD2 or FCD3
64-bit Server Express FCD3

Both FCD2 and FCD3 format can be used in 32-bit compilations. The copybook XFHFCD.CPY defines an FCD3 record unless the program is compiled with the Compiler directive NOFCD3. If the program is compiled with the NOFCD3 directive XFHFCD.CPY defines an FCD2 record. The FCD3 record is directly and unconditionally defined in the file xfhfcd3.cpy and the FCD2 record is directly and unconditionally defined in the file xfhfcd2.cpy.

To use the File Handler, your program must set up an FCD, complete the appropriate fields (these vary according to the operation code) and then call the File Handler. All unused or reserved areas of the FCD must be set to binary zeros. The File Handler returns information to your program by writing it to the appropriate fields in the FCD.

Note: Regardless of the system you are using, you must set the fcd-version field to the appropriate value for the FCD that you are using (0 for FCD2, 1 for FCD3); otherwise some of the operation codes will not behave as expected.

The FCD used on the call to open a file must be the one used on all subsequent accesses to that file. You can perform multiple open operations on a file but you must use a different FCD for each open.

The FCD includes pointers (that is, USAGE POINTER data items) that point to the record area, filename area and key definition block.