SQL/MP Programming Manual for COBOL

Memory Considerations
HP NonStop SQL/MP Programming Manual for COBOL529758-003
B-4
Using the SQLMEM Directive
SQLBVARS Structure
If the SLT-INDEX item of SQLINn is -1, the HP COBOL compilers creates an
SQLBVARS entry. This entry occurs when a qualified cursor or statement name has a
qualifying program name other than the current program name. The SQLBVARS entry
follows the declaration of its corresponding SQLIN:
05 SQLBVARSn.
10 EYE-CATCHER PIC X(2) VALUE "VB".
10 NUM-ENTRIES PIC S9(4) COMP VALUE 2.
10 BVARS1.
15 DATA-TYPE PIC S9(4) COMP VALUE proc-type.
15 DATA-LEN PIC S9(4) COMP VALUE length.
15 RESERVED0 PIC S9(4) COMP VALUE 0.
15 VAR-PTR PIC S9(9) COMP VALUE -999999.
15 IND-PTR PIC S9(9) COMP VALUE -999999.
10 BVARS2.
15 DATA-TYPE PIC S9(4) COMP VALUE cursor-type.
15 DATA-LEN PIC S9(4) COMP VALUE length.
15 RESERVED0 PIC S9(4) COMP VALUE 0.
15 VAR-PTR PIC S9(9) COMP VALUE -999999.
15 IND-PTR PIC S9(9) COMP VALUE -999999.
05 SQLBVARS-PROC-NAMEn PIC X(32) VALUE procedure-name.
05 SQLBVARS-CUR-STMT-NAMEn PIC X(30) VALUE statement-name.
Using the SQLMEM Directive
The SQLMEM compiler directive specifies where in memory (user data segment or
extended data segment) the HP COBOL compiler should place the internal SQL data
structures. Although a program does not explicitly declare the SQL internal data
structures and cannot directly access them, it can control their placement in memory.
Specify the SQLMEM directive before the Data Division in a COBOL program using
this syntax:
USER
directs the compiler to place the SQL data structures in the user data segment
(Working-Storage Section) even if the program includes an Extended-Storage
Section.
EXT
At run time, the system automatically creates an extended data segment for a
COBOL program and places the SQL structures in this segment, even if the
program does not include an Extended-Storage Section.
EXT is the default.
SQLMEM { USER | EXT }