INCLUDE

The INCLUDE statement (embedded SQL only) inserts declarations or code into source programs from external files.

Invocation

INCLUDE can only be embedded in a host language. INCLUDE is not an executable command and cannot be dynamically prepared.

Authorization

No special authorization is needed for INCLUDE.

Syntax

INCLUDE {SQLCA | SQLDA | member-name}

Parameters:

member-name The member name (or file name) can contain any host language source statements or SQL statements, except the INCLUDE statement. In COBOL, the statement "INCLUDE member-name" must not appear anywhere other than the DATA DIVISION or the PROCEDURE DIVISION section. See your XDB Server precompiler documentation for specifics about the member-name parameter.

Description

The INCLUDE statement is used to bring external files (containing either data definitions or segments of program code that must be precompiled) into an application. When precompiled, the INCLUDE statement is replaced by the source statements. The INCLUDE statement must therefore be specified at a point in the application program where the resulting source statements are accepted by the compiler. The INCLUDE statement cannot introduce source statements that themselves contain INCLUDE statements. Depending on the host language used, INCLUDE can also identify SQL communication and descriptor areas.

SQLCA

Indicates an SQL communication area (SQLCA) description is to be included. Do not specify INCLUDE SQLCA more than once in the same application program. See XDB Server SQL Communications Area (SQLCA) for more information about the SQLCA.

SQLDA

Indicates an SQL descriptor area (SQLDA) description is to be included. See XDB Server SQL Descriptor Area (SQLDA) for more information about the SQLDA.

Example:

The file must reside in the directory specified by the environment variable COBCPY (Micro Focus) or SYSLIB (CA-Realia II). The XDB Server precompiler looks for the file extensions .CPY and .CBL if the XDBCPY directive is active. With CA-Realia II, the XDB Server precompiler looks for the .COB extension by default. Consult your XDB Server precompiler documentation for further details.

EXEC SQL 
    INCLUDE emprec
END-EXEC