SQL/MP Programming Manual for COBOL

Converting COBOL Programs
HP NonStop SQL/MP Programming Manual for COBOL529758-003
D-2
Generating SQLDA Structures
INCLUDE STRUCTURES directive. For more information, see Section 9, Error and
Status Reporting.
Use the SQLCAGETINFOLIST procedure to return information from the SQLCA
structure. Do not access this structure directly. HP reserves the right to change it in
future PVUs.
Generating SQLDA Structures
If your existing COBOL program generates SQLDA structures and you are converting it
to run on version 300 (or later) SQL/MP software, you might need one or more of these
combinations of SQLDA structures:
A version 300 (or later) SQLDA structure
A version 1 or version 2 SQLDA structure
A version 300 (or later) SQLDA structure and a version 1 or version 2
SQLDA structure
Generating a Version 315 SQLDA Structure
To convert a program that generates a version 1 or version 2 SQLDA structure to
generate a version 300 (or later) SQLDA structure, follow these steps:
1. If necessary, remove the RELEASE1 or RELEASE2 option from the SQL compiler
directive or from the INCLUDE SQLDA directive. The HP COBOL compiler returns
an error if you specify the RELEASE1 or RELEASE2 option and the
INCLUDE STRUCTURES directive.
2. Remove any -R1 or -R2 suffixes appended to SQLDA field names.
3. If you are converting a version 1 SQLDA structure, make sure you initialize the
NULL-INFO and IND-PTR fields.
4. Add an INCLUDE STRUCTURES directive with the ALL VERSION 315 option:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 315 END-EXEC.
Or specify only the SQLDA VERSION 315 option:
EXEC SQL INCLUDE STRUCTURES SQLDA VERSION 315 END-EXEC.
5. Add the necessary Procedure Division statements to process the version 315
SQLDA structure. For the layout of a version 315 SQLDA structure and a
description of each field, see Section 10, Dynamic SQL Operations.
Generating a Version 2 SQLDA Structure
If you are converting a program to use the INCLUDE STRUCTURES directive, but you
require a version 2 SQLDA structure, follow these steps: