Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to an SQL database from Fujitsu Cobol 97

Status
Not open for further replies.

necrom2

Technical User
Jul 3, 2003
2
US
Hi, We are trying to connect to an SQL database from Cobol 97 and are getting the following error message : JMP0371L-U ENVIRONMENT INFORMATION FILE ERROR TO PERFORM SQL. '@SQL_SERVER'. We've check the .inf file and the cobol environment variable and they both seem to be correct. Does anyone know what else would cause this error message.

Thanks,
necrom2
 
Necrom,

According to the manual the @SQL_SERVER error is saying you have not defined a server name in the INF file. When you are issuing the SQL CONNECT are you trying to connect to DEFAULT or to a specific server name? In either case you have to have a server name in the INF file the same as what is in your connect clause.

So...if you say "EXEC SQL CONNECT TO DEFAULT END-EXEC"

then you have to have DEFAULT specified as your Server Name in the INF file. (BTW, always use the INF File Utility to create the INF files. Much easier and fool-proof).

So whatever name you use in the connect statement has to be in the INF file as well.

Hope this helps!
 
Thanks cblkid, we had an "-" character instead of a "_" in one of the sections of our .inf file.
 
Hi Necrom2

You need to use the SQLODBCS.EXE program to set the connection with a database.
This application is normally stored in your Fujitsu Cobol installation folders.

Hope in this help
Gianni
 
SQL SERVER

I may be on the wrong frequency with my response but I think this is the answer, if not it's a good tutorial.

For a server based relational database system to support distributed requests from multiple HTML web clients it must have a server program running on the server system to support concurrent data access from each web program. It works like this. A client program(HTML web page) passes requested data-keys to a cgi server program(example: perl) on the server-site, which puts together a SQL request to retrieve some data. Since many users may use the same web site to process the same file & maybe the same record(like a seat on an airplane). Other web pages may also access the same airplane's seating record. If each of these requests(multiple concurrent executing server programs) were allowed to read & update the records at the same time with out co-ordinating their requests then all kinds of integrity problems could arise. To remove this problem, each perl cgi program acts like a client to the database-SQL-server program and gets monitored to avoid integrity problems. The same protection could have been completely coded in each perl program but that would generate a lot of extra coding and testing. This way one general purpose SQL-database-server program protects the database for all of the perl-cgi-client programs which in turn acts as a server to the HTML-web-client-program.

Back to the question, for a HTML-web-program to use a cgi-perl server program, the perls request will require that the SQL-database program have been started. A connect has to have a SQL-server program already running.

When testing MySQL on my PC I have to start a database-server, once each initial system load, to have it running when I try to test my perl programs.

Each program in a system may function as a client, server or both depending from what perspective you view it from. Even COBOL calls a SQL server program to get it'd data requests serviced. All systems are designed to run in client-server relationship environment. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top