(Contents)(Previous)(Next)

Generating Host Variables

The INCLUDE statement can be used to generate a record as a host variable for a table by means of precompilation (syntax see Section INCLUDE Statements). To do so, the option CHECK must be set. Then a database session with the predefined user specifications will be opened in order to be able to fetch the corresponding pieces of information from the database and to generate the include file.

The record is provided in the include file. The include file is only generated when it is not yet available. Otherwise, it is inserted into the source file instead of the INCLUDE statement. The name of the table (default) or any other name (AS clause) may be given to the record. The level number of the record is '01' (default) or may be any number. Another record may be generated in addition which can be specified as indicator (IND clause). Any level number and name are also allowed in this clause. The component names are derived from a table's column names. In this case, the underscore character is replaced by a hyphen. The names of the indicator record are also derived from the table and column names; they are provided with the prefix 'I'.

FIXED-type columns are represented as decimal numbers (PACKED-DECIMAL), FLOAT-type columns are represented as COMP-1 or COMP-2, and all the other column types are represented as character strings.

Example:

A table may be defined by

Then a program can contain the following statements:

The INCLUDE statements generate the declarations:


(Contents)(Previous)(Next)