PRB: ESQL: R6009 - Out of Environment Space

Last reviewed: May 5, 1997
Article ID: Q72943

The information in this article applies to:

  - Microsoft Embedded SQL version 4.2 for COBOL

SYMPTOMS

When running an Embedded SQL for COBOL MS-DOS application that either links with COBLIB or is compiled into a .GNT file, the program reports the following error:

   R6009 - out of environment space

CAUSE

The COBOL run-time system, either COBLIB or the Micro Focus resident run- time system, needs to know at startup how much memory should be freed back to the application for use by non-COBOL code. Since the library that handles the SQL Server connections was written in C, it is not allowed any memory for dynamic allocation at run time. When this library attempts to allocate memory for connection and query management, it fails and returns the error listed above.

WORKAROUND

The environment variable COBPOOL will tell the run-time system how much memory to leave the program for non-COBOL functions. This variable is documented in the "Microsoft COBOL Operating Guide" and indicates how many kilobytes of memory should be freed. This number will depend on the number of connections in the program as well as query size. The following command will work for a very small program such as SQLDOS, which shipped with the Embedded SQL for COBOL package:

   SET COBPOOL=10

This allows 10K to be used for non-COBOL functions, such as the Embedded SQL for COBOL functions that need to dynamically allocate memory.


Additional query words:
Keywords : kbother SSrvCobol
Version : 4.2
Platform : OS/2
Issue type : kberrmsg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.