contents.gifindex.gifprev1.gifnext1.gif

7.3 Using Directives

Directives are optional comments that you can place into an FD in your COBOL source code to control how the data dictionary is built. By controlling how data dictionaries are built, you can guide the way AcuODBC maps COBOL records to application data fields.

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

Directives enable you to:

odb90000.gif specify a column name to be used in place of a COBOL field name.

odb90000.gif map elementary items of a group item together into a single column.

odb90000.gif cause numeric COBOL data to be treated as a text string in the AcuODBC "virtual" database.

odb90000.gif 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).

odb90000.gif give a name to the data dictionary file itself.

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 data dictionaries, giving you a measure of control over the way COBOL data is mapped to data fields in your Windows application.


Remember: Each field in the Windows application must correspond to a data item in your COBOL FD or XFD. To ensure that this is the case, you may need to add fields to the data dictionary using the NAME directive.


Data dictionaries may be built directly from your source code with no directives if the compiler's default mapping rules are sufficient for your situation. If you would like to override the default mapping behavior, or map a field to a different name, then you would add directives to your COBOL code.

More:

7.3.1 Syntax

7.3.2 AcuODBC Hidden Directive

7.3.3 AcuODBC Read-Only Directive

7.3.4 Date Directive

7.3.5 File Directive

7.3.6 Name Directive

7.3.7 Numeric Directive

7.3.8 Use Group Directive

7.3.9 When Directive