SQL Descriptor Area (SQLDA)

Restriction: This topic applies to Windows environments only.

COBOL programs that include dynamic SQL must have an SQL Descriptor Area (SQLDA) defined. This definition is usually accomplished by including the SQLDA copybook provided with Enterprise Developer.

Important: Enterprise Developer does not default to using the XDB SQLDA. To ensure that Enterprise Developer uses the XDB SQLDA, you must add the path to the provided XDB copybooks to the Linked Resources list in your project properties. By default, this is %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\cpylib\xdb (Windows) or $COBDIR/copylib/xdb (UNIX). To do this, see the section To link to a folder containing copybooks in the topic To link to copybooks or sources outside the project. Be sure to specify the path to the XDB copybook files, and be sure this path appears at the top of the list of linked resources.

The default SQLDA copybook used by the SQL Option preprocessor is not mainframe DB2 compatible. Instead it is designed for easy compatibility if you are upgrading from older version of XDB or SQL Option software.

A mainframe compatible SQLDA is provided in the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\cpylib\xdb (Windows) or $COBDIR/copylib (UNIX) directory with filename of sqlda.cpy. If you want to use that copybook instead, just rename it. You then need to compile all programs that use this copybook or SQLDA's defined using the mainframe SQLDA structure with the SQL preprocessor directive SQLDA-VER=1 or the program will not map data properly and probably trap.

The SQLDA holds information about dynamic SQL queries, and is required for allocating the proper amount of space for the query.

For more information about dynamic SQL and the SQLDA, see the topic Using Dynamic SQL in COBOL. For a complete description of the SQLDA structure, see the SQL Reference. Refer to your preprocessor documentation on the use of pointer variables and for additional information on dynamic SQL in COBOL programs.