SQL/MP Programming Manual for COBOL85

HP NonStop SQL/MP Programming Manual for COBOL85429326-004
D-1
D Converting COBOL Programs
This appendix describes how a COBOL program developed for NonStop SQL/MP
version 1 or version 2 software can execute on SQL/MP version 300 (or later) software
without changes to its embedded SQL statements or directives. However, to use new
SQL features, you must modify and recompile the program.
Generating SQL Data Structures
The SQLCA, SQLSA, and SQLDA data structures can change in new PVUs of
SQL/MP. Table D-1 shows the SQL data structure and the changes that occurred with
each version.
Follow these guidelines if you are converting an existing COBOL program (that is, a
program that uses version 1 or version 2 structures) or writing a new program to use
version 300 (or later) SQL structures:
Use the INCLUDE STRUCTURES directive to specify the version of each structure
you require, even if you require version 1 or version 2 structures. To generate
version 300 or later SQL data structures, you must use the
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.
Table D-1. SQL Data Structures
Version Size, Bytes Eye-Catcher Literals New Fields
SQLCA Structure
1 430 CA None
2 430 CA None None
Š 300 430 CA None None
SQLSA Structure
1 838 SA None
2 838 SA None None
Š 300 838 SA None OUTPUT–COLLATIONS–LEN
SQLDA Structure
1 Variable DA None
2 Variable D1 None PRECISION, NULL–INFO, and
IND–PTR
Š 300 Variable D1 None CPRL–PTR, user-defined
collation buffer