OpenCOBOL Forum Index OpenCOBOL
Open cobol and databases | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| norbertm | Posted on: 2010/7/26 16:14 |
Just popping in ![]() ![]() Joined: 2010/7/22 From: Posts: 3 |
Open cobol and databases Hello,
i am working since 1980 with cobol, but the last 15 years, there were no possibilities to work with that language. So i m not on top of information. Is it possible to access Databases MS Access) with open cobol, and if yes, please give me an example |
| human | Posted on: 2010/7/26 19:46 |
Home away from home ![]() ![]() Joined: 2007/5/15 From: Posts: 967 |
Re: Open cobol and databases You would need an ODBC wrapper for that (enabling you to use CALL xyz to access the files) and I'm not aware of something you could use out-of-the-box.
human |
| Franklin | Posted on: 2010/7/27 6:08 |
Not too shy to talk ![]() ![]() Joined: 2006/6/22 From: Hamburg, Germany Posts: 21 |
Re: Open cobol and databases You could try the ESQL for ODBC for OpenCobol from Sergey,
you will find it here: http://www.kiska.net/opencobol/esql/ This consists of a precompiler for embedded SQL and a runtime library to actually access the ODBC database. Franklin |
| norbertm | Posted on: 2010/7/28 8:13 |
Just popping in ![]() ![]() Joined: 2010/7/22 From: Posts: 3 |
Re: Open cobol and databases ok thanks, i have found them. But how must this programms be installed in the cobol enviroment?
in former times cobol was running as sub program, f.e under dl1. The first statment was an entry 'dl1tocbl'. How found cobol nopw the link to the sql software? |
| wmklein | Posted on: 2010/7/28 10:11 |
Home away from home ![]() ![]() Joined: 2008/12/27 From: Posts: 243 |
Re: Open cobol and databases For non-IBM people
dl1 tells me that this was (originally) an IBM, IMS program. I don't think anyone has tried to "integrate" any IMS emulator with OpenCOBOL, but I could be mistaken on that. However, if your "database" program is ONLY SQL, then everything should be fine. If it is IMS, then I think this is a "new" area for research. |
| norbertm | Posted on: 2010/7/28 16:33 |
Just popping in ![]() ![]() Joined: 2010/7/22 From: Posts: 3 |
Re: Open cobol and databases Sorry but you did'nt understand my intension. I don't want to get DL1 back. Time of this is over.
It is my inetrest, to understand, how the communication between cobol and sql-interface take place. But first of all the inforamtion how to integrate the sql interface to open cobol. Please give me an install guide. THanks. |
| Franklin | Posted on: 2010/7/29 11:50 |
Not too shy to talk ![]() ![]() Joined: 2006/6/22 From: Hamburg, Germany Posts: 21 |
Re: Open cobol and databases I'm sorry there is no installation guide for this.
I just wrote you a small sample program to get you on your way. Create an Access Database called MYTESTDB. The table definition can also be found in my sample code. Setup an ODBC datasource to this database. You can paste this code in to a file called "testsql.sqb" Now precompile this file with the following command: After this you should be able to see the results in a file called "testsql.cob", this is the source that you can compile using OC. I hope this helps you! Franklin |
| btiffin | Posted on: 2010/7/30 8:09 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 755 |
Re: Open cobol and databases norbertm;
Take a look at http://www.opencobol.org/modules/newbb/viewtopic.php?topic_id=575&forum=1#forumpost3089 for samples of how to go about such things. You'll likely need to write some C and definitely need to manage the cobc -I and -l (little ell) and -L. Usually -l libname gets the proper linkage for your calls, -L to point to the dll file path. Cheers, Brian |
| JohnnyMac | Posted on: 2010/8/31 13:51 |
Just popping in ![]() ![]() Joined: 2010/8/31 From: Boston Mass Posts: 3 |
Re: Open cobol and databases Hi Franklin, I am new to using OC with CYGWIN, I'm trying to access a MS Access DB and successfully created testsql.cob my following your precompile instructions, after I execute the dos2unix and cobc compile, I run ./testsql but get error datasource not found, so I opened the testsql.con and noticed that the SQL statements were all commented out, did I miss a step ?
Thanks JohnnyMac poster 9:51am from Boston MA on 8/31/2010 |
| human | Posted on: 2010/8/31 19:27 |
Home away from home ![]() ![]() Joined: 2007/5/15 From: Posts: 967 |
Re: Open cobol and databases SQL-statements must be commented out by the pre-parser and there has to be some stuff (mainly calls) inserted (this is how SQL-pre-parser always work).
I guess you didn't create the ODBC data source named MYTESTDB pointing to you Access DB? human |
| (1) 2 » | |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |








