SQL/MP Programming Manual for COBOL

HP NonStop SQL/MP Programming Manual for COBOL529758-003
B-1
B Memory Considerations
This appendix describes the SQL internal data structures generated in a COBOL
program, including this information:
Using the SQLMEM directive to control the placement of the SQL internal
data structures
Estimating the memory required by a COBOL program
Topics include:
SQL/MP Internal Structures
Resizing Segments on page B-2
Avoiding Name Conflicts on page B-2
Using the SQLMEM Directive on page B-4
Estimating Memory Requirements on page B-5
Memory Requirements on page B-5
Guidelines for Memory Use on page B-6
SQL/MP Internal Structures
The HP COBOL compiler generates the SQLINALL internal data structure to maintain
information about the SQL statements and host variables used in the program.
Depending on the statements used in a program, SQLINALL can contain these
substructures:
SQLINn for each SQL statement that generates a call to the SQL executor
SQLVARSnI for each input host variable in the program
SQLVARSnO for each output host variable in the program
Each SQL structure or substructure name includes an identification number (n)
assigned by the HP COBOL compiler. Although you cannot directly manipulate these
structures, you can control their placement in memory and avoid using their names in
your own structures.
The system automatically creates an extended data segment for each COBOL
program at run time and places the SQL internal structures in this extended data
segment, even if you do not declare an Extended-Storage Section in your program. If
your program requires the SQL internal structures to be placed in the user data
segment (for example, for a program that runs as a process pair), see Using the
SQLMEM Directive on page B-4.
All Extended-Storage Sections in a main program and in any subprograms called by
the main program are automatically consolidated into the single extended data
segment allocated by the main program. You do not need to use the Binder program to