Admin Production rocket
Current Publication

Introduction

Visual COBOL for Visual Studio 2017 V7.0
Rocket® Visual COBOL® (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

Introduction

Restriction: This topic applies only when a Database Connectors license has been installed via the Micro Focus License Management System.

EXtended File Descriptors (XFDs) are based on your COBOL File Descriptors (FDs). Each XFD describes all of the fields for one file.

XFD directives are optional comments that you can use in your FDs to control how things look on the database side. Many applications use only the CREATEXFD directive. XFD directives are most commonly used when a site intends to do a lot of work with the relational database management system (RDBMS) outside of the COBOL application, and wants to control how the database table is built.

XFD directives are special comments placed into an FD in your COBOL source code. They guide the building of the XFDs, which in turn guide the building of the database table.

Each XFD directive includes the letters XFD. These three letters indicate to the compiler that the comment is to be used in XFD generation.

XFD directives provide extended control over how the database table is built. Among other things, they let you:

  • Specify a column name to be used in the database table, in place of a COBOL field name.
  • Map elementary items of a group item together into a single column.
  • Cause numeric COBOL data to be treated as a text string in the database.
  • Cause the fields from a specific record in a file to appear in the database table (rather than just the fields from the largest record).
  • Assign a column the DATE type, providing the built-in functionality that dates have in the RDBMS.
  • Give a name to the XFD file itself.

XFD directives are always placed within a COBOL FD. They do not affect Procedure Division I/O statements, and they do not change your COBOL fields in any way. Rather, they guide the building of the XFDs, giving you control over the way COBOL data maps to database fields.

You can build XFDs directly from your source code with only the CREATEXFD directive if the default mapping rules described in XFDs and New and Existing Databases are sufficient for your situation. Unlike the XFD directives, the CREATEXFD directive can be specified on the command line or within your project properties if you do not want to place the directive in your program. If you would like to override the default mapping behavior or map a field to a different name, you must add additional XFD directives to your COBOL code.