SQL/MP Programming Manual for COBOL

Memory Considerations
HP NonStop SQL/MP Programming Manual for COBOL529758-003
B-2
Resizing Segments
perform this function, and you do not need to allocate space in your data stack or your
Extended-Storage Section for these data structures.
Resizing Segments
The SQL executor and any utilities that use the SQLINALL data structure use Guardian
procedures for resizing an existing extended segment. Therefore, you do not need to
be concerned about the size of the extended data segments that NonStop SQL/MP
uses to store the SQLINALL data structure.
If an executing program requires more memory, SQL/MP automatically increases the
size of extended data segments. As a result, different listings from different executions
of the same program could show different memory sizes. This difference reflects the
dynamic memory management provided by SQL/MP.
The HP COBOL compiler initializes all the pointers in the SQLINALL structure in the
SQL-INIT section, which the compiler writes at the end of the source program. To
initialize the pointers, the compilers insert a call to the SQLADDR procedure.
Avoiding Name Conflicts
In a COBOL program, avoid using names that conflict with the names in the internal
SQL data structures. The section names generated by the HP COBOL compiler in your
program are SQLDO-n (where n is an integer) and SQL-INIT. These examples show
the names used in internal SQL structures.
SQLINALL Structure
The SQLINALL structure is shown in the next example. The HP COBOL compiler
generates an SQLINn substructure for each SQL statement that causes a call to the
SQL executor.
01 SQLINALL-T9192-TANDEM.
05 STMT-PROCEDURE-ID PIC X(32) VALUE "proc-name".
05 SQLINIT-FLAG PIC S9(4) COMP VALUE -1.
05 SQLINn
10 EYE-CATCHER PIC X(2) VALUE "IN".
10 VERSION PIC S9(4) COMP VALUE 0.
10 SLT-INDEX PIC S9(4) COMP VALUE index.
10 PROCEDURE-ID PIC X(32) VALUE "proc-name".
10 USER-LINE-NUMBER PIC S9(9) COMP VALUE line.
10 STMT-PROCEDURE-ID-PTR PIC S9(9) COMP VALUE -999999.
10 SRCFILE-PTR PIC S9(9) COMP VALUE -999999.
10 OPCODE PIC S9(4) COMP VALUE opcode.
10 FLAGS PIC S9(4) COMP VALUE 0.
10 P-CKSUM PIC S9(4) COMP VALUE 0.
10 IOVAR-CKSUM PIC S9(9) COMP VALUE 0.
10 IVARS-PTR PIC S9(9) COMP VALUE -999999.
10 OVARS-PTR PIC S9(9) COMP VALUE -999999.
10 SQLSA-PTR PIC S9(9) COMP VALUE -999999.