INF: COBLIB: .EXE Calling .GNT Files with ESQL for COBOL

Last reviewed: May 5, 1997
Article ID: Q73005

The information in this article applies to:

  - Microsoft Embedded SQL version 4.2 for COBOL

SUMMARY

There is a sample application named COBLIB in the Software/Data Library that shows how to create an Embedded SQL for COBOL MS-DOS application consisting of an .EXE file linked with COBLIB that calls a .GNT file. This method is very useful for large MS-DOS applications because it lessens the memory required to load and execute the application.

MORE INFORMATION

The COBLIB sample file consists of source code for DRIVER.CBL and SQLDOS.CBL. It also includes COMPILE.CMD, which can be used to create the application. SQLDOS.CBL is the same program that is included in the Embedded SQL for COBOL Developer's Kit, except that it was modified to change all "stop run" statements to "exit program" statements. This allows control to return to DRIVER.EXE.

The basic idea is that DRIVER.EXE makes a call to SQLINTF.EXE to load the Embedded SQL for COBOL support and then calls SQLDOS.GNT to actually perform all the Embedded SQL for COBOL statements.

Please note that this requires that the COBPOOL environment variable be set. Do this by typing "SET COBPOOL=10" at the MS-DOS prompt.

To create a similar OS/2 application, modify the following line in DRIVER.CBL

   CALL "SQLINTF.EXE"

to read as follows:

   CALL "SQLINTF.DLL"

Then, modify the link line in COMPILE.CMD from the following

   link driver.obj,,,coblib+cobapi;

to the following:

   link driver.obj,,,coblib+os2;

COBLIB can be found in the Software/Data Library by searching on the word COBLIB, the Q number of this article, or S13133. COBLIB was archived using the PKware file-compression utility.


Additional query words:
Keywords : kbprg SSrvCobol SSrvProg
Version : 4.2 | 4.2
Platform : MS-DOS OS/2


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.