BookmarkSubscribeRSS Feed
mlogan
Lapis Lazuli | Level 10

Hi All,

I am having issue connecting to DB2 database server using sas base. Can someone assist me on how to accomplish that. I have tried following many online blog, but everything failed.

 

 

Thanks for your help

 

Shak

4 REPLIES 4
SASKiwi
PROC Star

First of all you can't access DB2 using Base SAS, you need the SAS product SAS/ACCESS to DB2 both installed and licensed. Has this been done? If so has anyone successfully used it yet?

andreas_lds
Jade | Level 19

Please post the code you used to connect to the db and the log of that step.

ErikLund_Jensen
Rhodochrosite | Level 12

Hi @mlogan 

 

Another possibility is to install an ODBC driver that acts as a bridge to DB2, so SAS can access DB2 batabases using access to ODBC and an entry in the odbc.ini file pointing to the DB2/ODBC driver. It works very well for us, both in out current Linux installation and earlier on Windows servers.

Unfortunately I can't be to further help when it comes to the technical details about installation and setup. We used external help for that part. 

 

Ksharp
Super User

Firstly, using " proc setinit;run; " to check if you have ACCESS/ODBC license,

if you have ODBC driver of DB2 , you could follow this ,

after config a data source succesfully ,

using " libname x odbc dsn= " to connect to DB2.

 

Ksharp_0-1663070318349.png

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1463 views
  • 1 like
  • 5 in conversation