SQL/MP Programming Manual for COBOL85
Memory Considerations
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
B-3
Avoiding Name Conflicts
SQLVARS Structure
If the SQL statement contains input or output host variables, the COBOL85 compilers
create an SQLVARSnI structure for each input variable and an SQLVARSnO structure
for each output variable as follows:
05 SQLVARSn{I|O}.
10 EYE-CATCHER PIC X(2) VALUE "D1".
10 NUM-ENTRIES PIC S9(4) COMP VALUE num-entries.
10 VARSn.
15 DATA-TYPE PIC S9(4) COMP VALUE datatype.
15 DATA-LEN NATIVE-2 VALUE length.
15 PRECISION PIC S9(4) COMP VALUE precision.
15 NULL-INFO PIC S9(4) COMP VALUE null-flag.
15 VAR-PTR PIC S9(9) COMP VALUE -999999.
15 IND-PTR PIC S9(9) COMP VALUE -999999.
15 CPRL-PTR PIC S9(9) COMP VALUE -999999.
15 RESERVED PIC S9(9) COMP VALUE -1.
For a host variable with a numeric, date-time, or interval data type, DATA-LEN is
replaced by this declaration:
15 DATA-SCALEN PIC S9(4) COMP VALUE length.
Depending on the data type of the host variable, the DATA-SCALEN data item has
values as follows:
For a host variable with a character, date-time or interval data type, PRECISION has
values as follows:
Data Type of Host Variable Value of DATA-SCALEN
Numeric Byte 1: scale
Byte 2: length
Date-time or interval Byte 1: Date-time qualifier
Byte 2: length
Data Type of Host Variable Value of PRECISION
Numeric Zero (0)
Date-time or interval Byte 1: leading field precision
Byte 2: fractional precision
Character Character set ID