INCLUDE

The INCLUDE statement inserts application code, including declarations and statements, into a source program.

Invocation

This statement can only be embedded in an application program. It is not an executable statement. It must not be specified in Java or REXX.

Authorization

None required.

Syntax

Read syntax diagram
>>-INCLUDE--+-SQLCA-------+------------------------------------><
            +-SQLDA-------+   
            '-member-name-'   

Description

SQLCA
Indicates that the description of an SQL communication area (SQLCA) is to be included. INCLUDE SQLCA must not be specified more than once in the same application program. In COBOL, INCLUDE SQLCA must be specified in the Working-Storage Section or the Linkage Section. INCLUDE SQLCA must not be specified if the program is prepared (either with the DB2® precompiler or coprocessor) with the STDSQL(YES) SQL processing option.

For a description of the SQLCA, see SQL communication area (SQLCA).

SQLDA
Indicates that the description of an SQL descriptor area (SQLDA) is to be included. It must not be specified in a Fortran. For a description of the SQLDA, see SQL descriptor area (SQLDA).
member-name
Names a member of the partitioned data set to be the library input when your application program is prepared (either with the DB2 precompiler or coprocessor). It must be an SQL identifier.

The member can contain any host language source statements and any SQL statements other than an INCLUDE statement. In COBOL, INCLUDE member-name must not be specified in other than the Data Division or the Procedure Division.

Notes

When your application program is prepared (either with the DB2 precompiler or coprocessor), the INCLUDE statement is replaced by source statements. Thus, the INCLUDE statement must be specified at a point in your application program where the resulting source statements are acceptable to the compiler.

The INCLUDE statement cannot refer to source statements that themselves contain INCLUDE statements.

The declarations that are generated by DCLGEN can be used in an application program by specifying the same member in the INCLUDE statement as in the DCLGEN LIBRARY parameter.

Example

Include an SQL communications area in a PL/I program.
  EXEC SQL INCLUDE SQLCA;