Mainframe access to SQL server data

5 pts.
Tags:
SQL Server
How can I access SQL server data from a mainframe COBOL program?

Software/Hardware used:
COBOL
ASKED: December 18, 2009  6:35 PM
UPDATED: October 16, 2013  9:02 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Not sure if it will work from mainframe COBOL, but from WINTEL COBOL (MicroFocus), this works:

EXEC SQL
               SELECT COLUMN_NAME
               INTO   :VARIABLE_NAME
               FROM   TABLE_NAME
               WHERE  COLUMN 1 = :VARIABLE1   AND
                      COLUMN 2 = 'Hard Coded Value'  
             END-EXEC.

============================================================

Since Microsoft is the DB vendor, all you need to do is obtain the appropriate ODBC or OLE DB or whatever type of driver function from them that they have available. Of course, Microsoft isn’t known for supplying drivers for use on other platforms, so you might have to look for other possibilities.

Nowadays, the common solution has been to use JDBC with a Type 4 JDBC driver. Your COBOL would access a Java procedure on the mainframe that would use JDBC to interact with SQL Server. AFAIK, Microsoft’s current JDBC is a type 4 driver. It requires JRE 5.0 or higher. I don’t know how much info is available on installing this on a mainframe.

I’m not aware of any other possibilities without installing some intermediate product.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following