SQL/MP Programming Manual for COBOL

Converting COBOL Programs
HP NonStop SQL/MP Programming Manual for COBOL529758-003
D-5
Generating a Version 1 SQLDA Structure
Generating a Version 1 SQLDA Structure
If you are converting a program to use the INCLUDE STRUCTURES directive, but you
require a version 1 SQLDA structure, follow these steps:
1. If necessary, remove the RELEASE1 option from the SQL compiler directive or the
INCLUDE SQLDA directive. The HP COBOL compiler returns an error if you
specify the RELEASE1 option and the INCLUDE STRUCTURES directive.
2. If you specified the RELEASE1 option in an INCLUDE SQLDA directive, remove
any -R1 suffixes you appended to SQLDA field names.
3. Add an INCLUDE STRUCTURES directive with the ALL VERSION 1 option:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 1 END-EXEC.
Or specify only the SQLDA VERSION 1 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 1 END-EXEC.
NULL-INFO For input parameters, NULL-INFO contains a negative integer if the
column permits null values.
For output columns, NULL-INFO contains a negative integer if the row
returned is null.
VAR-PTR The extended address of the actual data (value of input parameter or
column). SQL/MP does not return VAL-PTR. Your program must initialize
VAR-PTR to point to the input and output data buffers.
IND-PTR The address of a flag that indicates whether a parameter or column is
actually null.
For input parameters, your program initializes IND-PTR to -1 if the
user entered a null value.
For output columns, SQL initializes the location IND-PTR points to -1
if the user entered a null value.
If your program does not need to process null values, initialize IND-PTR
to an invalid address.
Table D-2. Version 2 SQLDA Structure Fields (page 3 of 3)
Field Name Description