Defining SQL descriptor areas in COBOL

If your program includes certain SQL statements such as DESCRIBE, you must define at least one SQL descriptor area (SQLIMSDA). Depending on the context in which it is used, the SQLIMSDA stores information about prepared SQL statements or host variables. This information can then be read by either the application program or IMS.

Procedure

To define SQL descriptor areas:

  1. Use the following SQL INCLUDE statement to request a standard SQLIMSDA declaration:
    EXEC SQLIMS INCLUDE SQLIMSDA
  2. You must place SQLIMSDA declarations in the WORKING-STORAGE SECTION, LINKAGE SECTION or LOCAL-STORAGE SECTION of your program, wherever you can specify a record description entry in that section. You must place SQLIMSDA declarations before the first SQL statement that references the data descriptor.