Previous Topic: Referring to Host VariablesNext Topic: Copying 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 COBOL program:

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

SQLCA Structure

This is the COBOL format of the SQLCA:

COBOL/CA ADS SQLCA

    01  SQLCA.         02  SQLCAID                 PIC X(8).         02  SQLCODE                 PIC S9(9) COMP.         02  SQLCSID                 PIC X(8).         02  SQLCINFO.          03  SQLCERC                PIC S9(9) COMP.          03  FILLER                 PIC S9(9) COMP.          03  SQLCNRP                PIC S9(9) COMP.          03  FILLER                 PIC S9(9) COMP.          03  SQLCSER                PIC S9(9) COMP.          03  FILLER                 PIC S9(9) COMP.          03  SQLCLNO                PIC S9(9) COMP.          03  SQLCMCT                PIC S9(9) COMP.          03  SQLCARC                PIC S9(9) COMP.          03  SQLCFJB                PIC S9(9) COMP.          03  FILLER                 PIC S9(9) COMP.          03  FILLER                 PIC S9(9) COMP.         02  SQLCINF2 REDEFINES SQLCINFO.          03  SQLERRD                PIC S9(9) COMP                                     OCCURS 12.         02  SQLCMSG.          03  SQLCERL                PIC S9(9) COMP.          03  SQLERM                 PIC X(256).         02  SQLCMSG2 REDEFINES SQLCMSG.          03  FILLER                 PIC X(2).          03  SQLERRM.           04  SQLCERRML             PIC S9(4) COMP.           04  SQLERRMC              PIC X(256).         02  SQLSTATE                PIC X(5).         02  SQLCRNF                 PIC X(1).         02  SQLCNRRS                PIC S9(4) COMP.         02  FILLLER                 PIC X(8).                                            ────┐         02  SQLWORK                 PIC X(16). │         02  SQLCWRK2 REDEFINES SQLWORK.        │          03  SQLERRP.                          │           04  SQLCVAL               PIC X(5).  │  Included by the           04  FILLER                PIC X(3).  │  precompiler for          03  SQLWARN.                          │  DB2 compatibility;           04  SQLWARN0              PIC X(1).  │  not used by CA IDMS           04  SQLWARN1              PIC X(1).  │           04  SQLWARN2              PIC X(1).  │           04  SQLWARN3              PIC X(1).  │           04  SQLWARN4              PIC X(1).  │           04  SQLWARN5              PIC X(1).  │           04  SQLWARN6              PIC X(1).  │           04  SQLWARN7              PIC X(1).  │                                            ────┘