SQL/MP Programming Manual for COBOL85
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
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 
SQL/MP Internal Structures
The COBOL85 compilers generate 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 COBOL85 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 
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 










