Previous Topic: Referring to Host VariablesNext Topic: Including Information from the Dictionary


Including SQL Communication Areas

Declaring SQL Communication Areas

CA IDMS provides these ways of including the SQL Communication Areas in a PL/I program:

Using the INCLUDE statement to declare the SQLCA is a CA IDMS extension of the SQL standard.

SQLCA Structure

This is the PL/I format of the SQLCA:

PL/I SQLCA

 DECLARE 1  SQLCA,            2  SQLCAID          CHARACTER (8),            2  SQLCODE          FIXED BINARY (31),            2  SQLCSID          CHARACTER (8),            2  SQLCINFO,              3  SQLCERC        FIXED BINARY (31),              3  FILLERnnnn     FIXED BINARY (31),              3  SQLCNRP        FIXED BINARY (31),              3  FILLERnnnn     FIXED BINARY (31),              3  SQLCSER        FIXED BINARY (31),              3  FILLERnnnn     FIXED BINARY (31),              3  SQLCLNO        FIXED BINARY (31),              3  SQLCMCT        FIXED BINARY (31),              3  SQLCARC        FIXED BINARY (31),              3  SQLCFJB        FIXED BINARY (31),              3  FILLERnnnn     FIXED BINARY (31),              3  FILLERnnnn     FIXED BINARY (31),            2  SQLCMSG,              3  SQLCERL        FIXED BINARY (31),              3  SQLCERM        CHARACTER (256),            2  SQLSTATE         CHARACTER (5),            2  SQLCRNF          CHARACTER (1),            2  SQLCNRRS         FIXED BINARY (15),            2  FILLERnnnn       CHARACTER (8),            2  SQLWORK          CHARACTER (16) ;  DECLARE 1 SQLCINF2 BASED (ADDR(SQLCINFO)),            2  SQLERRD   FIXED BINARY (31),  DECLARE 1 SQLCMSG2 BASED(ADDR(SQLCMSG)),            2  FILLERnnnn        CHARACTER (2),            2  SQLERRM,              3  SQLERRML        FIXED BINARY (15).              3  SQLERRMC        CHARACTER (256) ;                                           ────┐  DECLARE 1 SQLCWRK2 BASED(ADDR(SQLWORK)),     │            2  SQLERRP,                        │              3  SQLCVAL        CHARACTER (5), │  Included by the              3  FILLERnnnn     CHARACTER (3), │  precompiler for            2  SQLWARN,                        │  DB2 compatibility;              3  SQLWARN0  CHARACTER (1),      │  not used by CA IDMS.              3  SQLWARN1  CHARACTER (1),      │              3  SQLWARN2  CHARACTER (1),      │              3  SQLWARN3  CHARACTER (1),      │              3  SQLWARN4  CHARACTER (1),      │              3  SQLWARN5  CHARACTER (1),      │              3  SQLWARN6  CHARACTER (1),      │              3  SQLWARN7  CHARACTER (1) ;     │                                           ────┘