[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GnuCOBOL-users] How should I preprocess my source file on GNU/Linux

From: gnucobol
Subject: Re: [GnuCOBOL-users] How should I preprocess my source file on GNU/Linux with GNUCobol for SQL Server?
Date: Mon, 8 Oct 2018 10:19:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

I really appreciate having a response, thank you for the welcome ;)

I follow your instructions and reinstall ESQL as follow:


svn checkout open-cobol-contrib
cd open-cobol-contrib/trunk/esql
export CPLUS_INCLUDE_PATH=/opt/microsoft/msodbcsql/include/
 sh configure --with-mssql


We should have something like:


Use Microsoft SQL Server         YES




sudo make install


In that way, I probably avec MS SQL Server support.

I try the ODBC connection:


isql SQLServer sa myPassword -v
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |


Then I continue the tutorial to just have a connection and perform a status-check.

The pre-process gives me:


esqlOC: ESQL for GnuCOBOL/OpenCobol Version 2 (2018.10.03) Build Oct  8 2018
esqlOC: ERROR compiling program 'sql_odbc.cbl': line 35 of sql_odbc.cbl: variable not found: BUFFER


I also have this problem on my own code (and some other error, but I need first to be connected ^_^).

Have you any idea about the way to declare and use a variable for the connection to an ODBC database?

Thanks you in advance and have a nice week ;)

Olivier D.

Le 07/10/2018 à 21:45, Simon Sobisch a écrit :
Am 06.10.2018 um 21:01 schrieb address@hidden:
Hi all,

I'm Oliver. I come from Strasbourg (France) and I recently study Cobol
Hi Oliver and welcome to GnuCOBOL.

As I have no budget for Windows, I start using Cobol on GNU/Linux.
It is reasonable to not use Windows for many reasons (even if you'd get
it in exchange of "only" your privacy and security)

First it was awesome! I create PIC, SCREEN section, and make few things.
Good to hear.

But now we start connecting to a MS SQL Server. If I can start SQL
Server and do

ODBC connection on it with iSQL, it's another difficulty to make my code

with EXEC SQL command.

So my question is: what should I use to preprocess .cbl files with SQL

to connect to a SQL Server?
Depends on what your study uses. For COBOL you'd use in most cases EXEC
SQL (which does some setup and internal CALLs inserted by preprocessing)
some may prefer direct CALL to SQL libraries.

I found this
Reasonable. I'm not 100% sure if this is up-to-date and would always go
to its home in the GnuCOBOL contributions:

and installed esqlOC successfully. But some errors remains here:
As you don't posted any actual error it is not that likely that others
can point you to a solution.
I suggest to ensure you use the most current ESQL version and if errors
remain then post the actual errors.

Does anyone can do something with that or explain me how to use OpenESQL?
Obivously (or not?) you'd have to setup ODBC on your GNU/Linux
environment and get a working connection to a working SQL Server (not
100% sure about its current status on Linux OS, but if I remember
correctly this should be working at least for testing environments).

The link above includes a README, does this help already?

Thank you in advance!
Welcome again,
Olivier Dᴏꜱꜱᴍᴀɴɴ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]