2

I am trying to connect to a DB2 mainframe from my machine through Jupyter Notebooks. I am on a 32-bit machine Windows 7 machine. I am using Python version 3.6.1

Did a bit of research and from what i could find online there are two ways to do this....

Packages: pyodbc, ibm_db

I think i read in another post that the official way to do it is using ibm_db. I tried a couple of times with pyodbc but couldn't get it to work.

Error i am getting in pyodbc

So i figured i would try ibm_db. I tried install ibm_db using pip and easy_install but i keep getting the following messages.

Error Message

Could someone please provide some guidance?

Also, my ODBC Data Source Adminstrator Window, system DSN tab looks as follows I was trying to use the pyMainframe DSN but couldnt get that to work either. As you can see i do have an iSeries Access ODBC driver installed. Not sure if python can use this.

System DSN

I am a bit of a noob. Thanks in advance. Please let me know if you need any additional information

7
  • Do you have a "DB2 Run Time Client" installed on your Ms-Windows workstation? The ibm_db will use that. Please clarify the question to specify if you are connecting to DB2 for Z/OS or DB2 for i-series. Did you set the IBM_DB_HOME environment variable before launching python? Commented Aug 29, 2017 at 13:06
  • I was about to try installing the following...IBM Data Server Client....will this install what i need? www-01.ibm.com/marketing/iwm/iwm/web/reg/… . It is DB2 for Z/OS. No i have not set an IBM_DB_HOME because i am not sure what i need to set it to. Thank you for your help Commented Aug 29, 2017 at 13:31
  • The "IBM Data Server Client" will also work (the runtime client is smaller, drivers only). Ask your DB2 for Z/OS DBA for which version +fixpack of the Windows DB2 client to install (as the relevant bindfiles will already be bound on DB2 for Z/OS databases in that case) . You may also need the db2jcc_license_cisuz.jar file (ask your DBA if you have one, else get it from IBM's passport advantage website). The IBM_DB_HOME variable value would be the location of the DB2-client binaries on installation . The DBA will also tell you the DB2-connect gateway address to use. Commented Aug 29, 2017 at 13:43
  • DB2 -client binaries? Is this what gets installed when I install DB2 Runtime Client? I asked a co-worker and he said i need to install IBM DB2 Connect 9.5. Is this the same as the DB2 Runtime Client? Commented Aug 29, 2017 at 14:14
  • My helpdesk installed two pieces of software "IBM Data Server Client - DB2COPY1" and "IBM_DB2ConnectClient_V.9.5_R1.0"". I am able to connect to the mainframe when i use the command editor. I tried using the "Default DB2 and IBM Database Client Interface Selection Wizard". It appears to have placed some data under C:\ProgramFiles\IBM\SQLLIB\ there is a clidriver folder but there is no include subfolder. I see an include folder but it is at the same level as clidriver. Does this means i need to install something else as i still get the same message when using "easy_install ibm_db"? Commented Aug 30, 2017 at 12:32

2 Answers 2

2

The issue is that i was using python 3.6.1 For python 3 the only version supported is 3.4.0. No other version of 3.4 is supported, not sure about < 3.4

Thanks all for your help.

Here is where i found the answer. + a little trial and error. https://groups.google.com/forum/#!topic/ibm_db/6-sOpk4zkCU

Sign up to request clarification or add additional context in comments.

1 Comment

Python 3.6.2 (32-bit) works fine with DB2-client V11.1 (32-bit) and ibm_db 2.0.7 on Win7 64-bit. However, I see that Python.org states that for 32-bit Windows XP the currently highest supported Python is 3.4. I don't have a 32-bit Win7 to try that.
0

You're not connecting to a mainframe (z/OS) you're connecting to a midrange system (IBM i aka iSeries/AS-400) completely different machines and OS.

Using ibm_db requires the IBM DB2 connect product ($$$) to connect to IBM i.

You're going to want to use just an ODBC connection via pyodbc(?).

7 Comments

The target system that i am trying to connect to is a z/OS Mainframe
Then why are you trying to use an iSeries ODBC driver?
Because i am an inexperienced noob and had it there from another project i was working on. I had made the assumption that it was an iSeries but just found out a few minutes ago that it is a z/OS Mainframe. Do you know what driver i could use?
Ok, will go through it. Saw something similar on SO but it says that Python 3 is excluded. I will give it a shot and let you know if it works. Thanks.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.