DSQCOMM for PL/I

The interface communications area for PL/I, is named DSQCOMML.

/********************************************************************/
/* PL/I include for query callable interface                        */
/********************************************************************/
                                                                      
/* Structure declare for communications area                        */
DCL                                                                   
 1 DSQCOMM,                                                           
   3 DSQ_RETURN_CODE      FIXED BIN(31),   /* Function return code  */
   3 DSQ_INSTANCE_ID      FIXED BIN(31),   /* Start ID              */
   3 DSQ_COMM_LEVEL       CHAR(12),        /* Communications level  */
   3 DSQ_PRODUCT          CHAR(2),         /* Query product ID      */
   3 DSQ_PRODUCT_RELEASE  CHAR(2),         /* Query product release */
   3 DSQ_RESERVE1         CHAR(28),        /* Reserved              */
   3 DSQ_MESSAGE_ID       CHAR(8),         /* Completion message ID */
   3 DSQ_Q_MESSAGE_ID     CHAR(8),         /* Query message ID      */
   3 DSQ_START_PARM_ERROR CHAR(8),         /* Start parms in error  */
   3 DSQ_CANCEL_IND       CHAR(1),         /* Cmd cancel indicator  */
                                 /* 1 = cancelled, 0 = not cancelled*/
   3 DSQ_RESERVE2         CHAR(23),        /* Reserved              */
   3 DSQ_RESERVE3         CHAR(156),       /* Reserved              */
   3 DSQ_MESSAGE_TEXT     CHAR(128),       /* QMF command message   */
   3 DSQ_Q_MESSAGE_TEXT   CHAR(128);       /* QMF query message     */
                                                                      
/* Return codes                                                     */
DCL                                                                   
   DSQ_SUCCESS             FIXED BIN(31) INIT(0)  STATIC,             
   DSQ_WARNING             FIXED BIN(31) INIT(4)  STATIC,             
   DSQ_FAILURE             FIXED BIN(31) INIT(8)  STATIC,             
   DSQ_SEVERE              FIXED BIN(31) INIT(16) STATIC;             
                                                                      
/* Communications level                                             */
DCL                                                                   
   DSQ_CURRENT_COMM_LEVEL  CHAR(12) INIT('DSQL>001002<') STATIC;      
                                                                      
/* Query product ID                                                 */
DCL                                                                   
   DSQ_QRW                 CHAR(2) INIT('01') STATIC,                 
   DSQ_QMF                 CHAR(2) INIT('02') STATIC,                 
   DSQ_QM4                 CHAR(2) INIT('03') STATIC;                 

/* Query product release ID                                         */
DCL                                                                   
   DSQ_QRW_V1R2            CHAR(2) INIT('01') STATIC,                 
   DSQ_QRW_V1R3            CHAR(2) INIT('02') STATIC,                 
   DSQ_QMF_V2R4            CHAR(2) INIT('01') STATIC,                 
   DSQ_QMF_V3R1            CHAR(2) INIT('02') STATIC,                 
   DSQ_QMF_V3R1M1          CHAR(2) INIT('03') STATIC,                 
   DSQ_QMF_V3R2            CHAR(2) INIT('04') STATIC,                 
   DSQ_QMF_V3R3            CHAR(2) INIT('05') STATIC,                 
   DSQ_QMF_V6R1            CHAR(2) INIT('06') STATIC,                 
   DSQ_QMF_V7R1            CHAR(2) INIT('07') STATIC,                 
   DSQ_QM4_V1R1            CHAR(2) INIT('01') STATIC,                 
   DSQ_QMF_V7R2            CHAR(2) INIT('08') STATIC,                 
   DSQ_QMF_V8R1            CHAR(2) INIT('09') STATIC,                 
   DSQ_QMF_V9R1            CHAR(2) INIT('10') STATIC,                 
   DSQ_QMF_V10R1           CHAR(2) INIT('11') STATIC;                 
                                                                      
/* Cancelled indicator                                              */
DCL                                                                   
   DSQ_CANCEL_YES          CHAR(1) INIT('1') STATIC,                  
   DSQ_CANCEL_NO           CHAR(1) INIT('0') STATIC;                  
                                                                      
/* Variable types                                                   */
DCL                                                                   
   DSQ_VARIABLE_CHAR       CHAR(4) INIT('CHAR') STATIC,               
   DSQ_VARIABLE_FINT       CHAR(4) INIT('FINT') STATIC;               
                                                                      
/* Mode                                                             */
DCL                                                                   
   DSQ_INTERACTIVE         CHAR(1) INIT('1') STATIC,                  
   DSQ_BATCH               CHAR(1) INIT('2') STATIC;                  
                                                                      
/* Yes or no                                                        */
DCL                                                                   
   DSQ_YES                 CHAR(1) INIT('1') STATIC,                  
   DSQ_NO                  CHAR(1) INIT('2') STATIC;     

/* Query interface entry point                                      */
DCL                                                                   
   DSQCIPL ENTRY (*,                       /* Interface block       */
                  FIXED BIN(31),           /* Length of command     */
                  CHAR(*))                 /* Command string        */
                  EXTERNAL OPTIONS(ASSEMBLER);                        
DCL                                                                   
   DSQCIPX ENTRY (*,                       /* Interface block       */
                  FIXED BIN(31),           /* Length of command     */
                  CHAR(*),                 /* Command string        */
                  FIXED BIN(31),           /* # of command keywords */
                  *,                       /* Length of keyword     */
                  *,                       /* Keyword string        */
                  *,                       /* Length of value       */
                  *,                       /* Value of keyword      */
                  CHAR(4))                 /* Data type of value    */
                  EXTERNAL OPTIONS(ASSEMBLER);