INCLUDE

The INCLUDE statement inserts declarations or 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 REXX.

Authorization

The authorization ID of the statement must have the system authorities *OBJOPR and *READ on the file that contains the member.

Syntax

>>-INCLUDE----+-SQLCA-------+----------------------------------><
              +-SQLDA-------+
              '-member-name-'
 

Description

SQLCA
Indicates the description of an SQL communication area (SQLCA) is to be included. INCLUDE SQLCA must not be specified more than once in the same program. Include SQLCA must not be specified if the program includes a stand-alone SQLCODE or a stand-alone SQLSTATE.

An SQLCA can be specified for C, COBOL, and PL/I. If the SQLCA is not specified, the variable SQLCODE or SQLSTATE must appear in the program. For more information, see "SQL Return Codes".

The SQLCA should not be specified for RPG programs. In an RPG program, the precompiler automatically includes the SQLCA.

For a description of the SQLCA, see Appendix B, SQL Communication Area.

SQLDA
Indicates the description of an SQL descriptor area (SQLDA) is to be included. INCLUDE SQLDA can be specified in C, COBOL, PL/I, and ILE RPG/400.

For a description of the SQLDA, see Appendix C, SQL Descriptor Area (SQLDA).

member-name
Identifies a member to be included from the file specified on the INCFILE parameter of the CRTSQLxxx command.

The member can contain any host language 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 PROCEDURE DIVISION.

When your program is precompiled, the INCLUDE statement is replaced by source statements.

The INCLUDE statement must be specified at a point in your program where the resulting source statements are acceptable to the compiler.

Notes

If the CCSID of the source file specified on the SRCFILE parameter is different from the CCSID of the source file specified on the INCFILE parameter, the source from the INCLUDE statement is converted to the CCSID of the source file.

Example

Include an SQL communication area in a PL/I program.

   EXEC SQL  INCLUDE SQLCA;


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]