SQL/MP Programming Manual for COBOL

HP NonStop SQL/MP Programming Manual for COBOL529758-003
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.
Topics include:
Generating SQL Data Structures
Generating SQLDA Structures on page D-2
Planning for Future PVUs on page D-8
Generating SQL Data Structures
The SQLCA, SQLSA, and SQLDA data structures can change in new PVUs of
SQL/MP. Table D-1 lists 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
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