contents.gifindex.gif

Summary of Acu4GL Directives

This topic briefly summarizes the directives described in the Using Directives section of this on-line user's guide. It is meant to be used for quick reference.

Alpha Directive

The ALPHA directive allows you to treat a data item as alphanumeric text in the database, when it is declared as numeric in the COBOL program.

Syntax

$XFD ALPHA
or
*(( XFD ALPHA ))

Binary Directive

The BINARY directive is used to specify that the data in the field could be alphanumeric data of any classification. Absolutely any data is allowed. Binary data is stored in a database-dependent format. This directive cannot be used in combination with the VAR-LENGTH directive.

Syntax

$XFD BINARY
or
*(( XFD BINARY ))

Comment Directive

The COMMENT directive is used to specify a comment that will be copied directly into the XFD file. Each comment entered with this directive will appear in the XFD file with the symbol "#" in column one.

Syntax

$XFD COMMENT text
or
*(( XFD COMMENT text ))

Date Directive

The DATE directive says, "I want to store this field in the database as a date." Because there's no COBOL syntax that identifies a field as a date, you may want to add this directive to differentiate dates from other numbers.

Syntax

$XFD DATE=date-format-string
or
*(( XFD DATE=date-format-string ))

This directive implies the NUMERIC directive.

The date-format-string is a description of the desired date format, composed of characters from the following list:

M month (01 - 12)

Y year (2 or 4-digit)

D day of month (01 - 31)

J Julian day (00000000 - 99999999)

E day of year (001 - 366)

H hour (00 - 23)

N minute

S second

T hundredths of a second

If no date-format-string is specified, then six-digit (or six-character) fields are retrieved as YYMMDD from the database. Eight-digit fields are retrieved as YYYYMMDD.

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, you would use this directive when the SELECT for the file has a variable ASSIGN name (such as ASSIGN TO FILENAME). In this situation, the interface cannot form a file name automatically, and you must provide a name.

A starting name is simply a short file name that 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.

Name Directive

The NAME directive assigns a database field name to the field defined on the next line.

Syntax

$XFD NAME=fieldname
or
*(( XFD NAME=fieldname ))

Numeric Directive

The NUMERIC directive allows you to treat a data item as an unsigned integer when it is declared as alphanumeric. You might use this when the data stored in the item is always numeric.

Syntax

$XFD NUMERIC
or
*(( XFD NUMERIC ))

Secondary-Table Directive

The SECONDARY-TABLE directive is Sybase and Miscrosoft SQL Server specific. It indicates that the next data item may be placed into a subordinate table, if the RDBMS allows subordinate tables, and if more than one table is necessary to accommodate the data.

Syntax

$XFD SECONDARY-TABLE
or
*(( XFD SECONDARY-TABLE ))

Use Group Directive

The USE GROUP directive allows you to enter a group item into the database as a single field, instead of using the elements contained in the group. This is necessary if the item is stored in a pre-existing database as a group rather than as individual fields.

Combining fields of data into meaningful groups for database storage also improves I/O efficiency.

Syntax

$XFD USE GROUP
or
*(( XFD USE GROUP ))

By default, the USE GROUP directive implies that the consolidated field is alphanumeric. If you want a numeric field, simply add the word "NUMERIC" at the end of the directive.

Var-Length Directive

The VAR-LENGTH directive requests that the data item that immediately follows the directive be assigned a variable type that implies variable length, if possible. The effects of this variable depend on the RDBMS. This directive cannot be used in combination with the BINARY directive.

Syntax

$XFD VAR-LENGTH
or
*(( XFD VAR-LENGTH ))

When Directive

The WHEN directive is used to tell Acu4GL how to handle multiple record types and REDEFINES. It lets you state under which conditions certain fields are defined.

Syntax

$XFD WHEN field=value (equals)
$XFD WHEN field<=value (is less than or equals)
$XFD WHEN field<value (is less than)
$XFD WHEN field>=value (is greater than or equals)
$XFD WHEN field>value (is greater than)
$XFD WHEN field!=value (is not equal to)
$XFD WHEN field=OTHER
or
*(( XFD WHEN field=value )) (also <, <=, >, >=, !=)

This is the end of the Summary of Acu4GL Directives section. Click the Contents button at the top of this window to return to the Contents page.