SQL/MP Programming Manual for COBOL

Converting COBOL Programs
HP NonStop SQL/MP Programming Manual for COBOL529758-003
D-7
Using a Combination of SQLDA Structures
Using a Combination of SQLDA Structures
Version 300 (or later) SQL/MP does not support different versions of SQLDA structures
in the same compilation unit. If your program requires more than one SQLDA structure
in a compilation unit, convert all SQLDA structures to version 315. However, if you
want to use a combination of SQLDA structures (for example, a version 2 structure and
a version 315 structure), follow these steps:
1. Separate your program into different compilation units so that the version 315
SQLDA structure and the supporting Procedure Division statements are in a
different compilation unit than the version 2 (or version 1) SQLDA structure and
Procedure Division statements.
2. Specify an INCLUDE STRUCTURES directive with the appropriate VERSION
clause in each compilation unit.
3. Compile each compilation unit separately.
4. Use the Binder program to combine the object files into a single target object file.
DATA-TYPE The data type of the parameter or output variable.
DATA-LEN The DATA-LEN value depends on the data type.
Fixed-length character The number of bytes in the string.
Variable-length character The maximum number of bytes in the string.
Decimal numeric Bits 0:7 contain the decimal scale.
Bits 8:15 contain the byte length of the item.
Binary numeric Bits 0:7 contain the decimal scale.
Bits 8:15 contain the byte length of the item (2,
4, or 8).
Date-time or INTERVAL Bits 0:7 contain one of these codes for the
range of the field.
Bits 8:15 contain the storage size of the item.
1 Year to Year 11 Year to Minute 20 Day to Minute
2 Month to Month 12 Year to Second 21 Day to Second
3 Day to Day 13 Year to Fraction 22 Day to Fraction
4 Hour to Hour 14 Month to Day 23 Hour to Minute
5 Minute to Minute 15 Month to Hour 24 Hour to Second
6 Second to Second 16 Month to Minute 25 Hour to Fraction
7 Fraction to Fraction 17 Month to Second 26 Minute to Second
8 Year to Month 18 Month to Fraction 27 Minute to Fraction
9 Year to Day 19 Day to Hour 28 Second to
Fraction
10 Year to Hour
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
it to point to the input and output data buffers.
Table D-3. Version 1 SQLDA Structure Fields (page 2 of 2)
Field Name Description