Previous Topic: Classes of UseNext Topic: Dynamic SQL for Non-SELECT Statements


Using DBXHAPR in Dynamic SQL

DBXHAPR is only for COBOL programs using dynamic SQL. COBOL does not allow the SQLDATA and SQLIND fields to be declared as pointer variables. When you nevertheless need to set them to the address of host variables in SQLVAR, follow these steps:

  1. Link DBXHAPR to the OBJLIB that is being used by adding the following to your COBOL programs:
    CALL 'DBXHAPR' USING <SQLDATA>, <host-var>.
    
  2. Set the address of each SQLDATA and SQLIND field used before SQLDA with the following in the linkedit step:
    INCLUDE OBJLIB(DBXHAPR)