Write and run SAS programs in your web browser

Enabling DB2 access in SAS Studio

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Enabling DB2 access in SAS Studio

I am trying to access a set of DB2 databases within SAS Studio and am running into errors included in the log file below.

In our stand alone version of SAS I get the same error if I forget to run

. /db2aix/db2inst1/sqllib/db2profile


prior to starting SAS. If I run the above code, there are no issues accessing DB2 in our install of SAS.

I have trield to execute db2profile statement as part of my SAS Studio autoexec as well as explicity running it within my script, neither of these methods seem to address this error

Thouhts / suggestions?

 

 ERROR: Could not load /usr/sas/SASFoundation/9.4/sasexe/sasdbu (106 images loaded)
 ERROR: 0509-022 Cannot load module /usr/sas/SASFoundation/9.4/sasexe/sasdbu.0509-150   Dependent module libdb2.a(shr_64.o) could 
        not be loaded.0509-022 Cannot load module libdb2.a(shr_64.o).0509-026 System error: A file or directory in the path name 
        does not exist.0509-022 Cannot load module /usr/sas/SASFoundation/9.4/sasexe/sasdbu.0509-150   Dependent module 
        /usr/sas/SASFoundation/9.4/sasexe/sasdbu could not be loaded.
 60         
 61         
 62         libname qdattest db2 db=mydb user=me using=XXXXXXXXX;
 ERROR: The SAS/ACCESS Interface to DB2 cannot be loaded. The SASDBU   code appendage could not be loaded.
 ERROR: Error in the LIBNAME statement. 

 


Accepted Solutions
Solution
‎08-11-2016 01:00 PM
Super User
Posts: 7,866

Re: Enabling DB2 access in SAS Studio

You need to include

. /db2aix/db2inst1/sqllib/db2profile

in the WorkspaceServer_usermods.sh file. This file is included in WorkspaceServer.sh before SAS is started.

 

db2profile sets environment variables, but SAS reads those from its own environment block, which is set immediately at startup. Running the db2profile from within SAS does not change this environment block.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 10,046

Re: Enabling DB2 access in SAS Studio

If you want use LIBNAME + DB2 engine to connect to DB2, you need make sure you have installed DB2 Client ,
and make sure have already build a category in SAS side to connect to DB2 successfully. Talk to your DB2 Admin.

Solution
‎08-11-2016 01:00 PM
Super User
Posts: 7,866

Re: Enabling DB2 access in SAS Studio

You need to include

. /db2aix/db2inst1/sqllib/db2profile

in the WorkspaceServer_usermods.sh file. This file is included in WorkspaceServer.sh before SAS is started.

 

db2profile sets environment variables, but SAS reads those from its own environment block, which is set immediately at startup. Running the db2profile from within SAS does not change this environment block.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 5

Re: Enabling DB2 access in SAS Studio

Posted in reply to KurtBremser

Thank you for the quick feedback.

 

I have a note into our sysadmin to make the changes, and will update this tread with the results.

Occasional Contributor
Posts: 5

Re: Enabling DB2 access in SAS Studio

Posted in reply to KurtBremser

That did the trick.


KurtBremser wrote:

You need to include

. /db2aix/db2inst1/sqllib/db2profile

in the WorkspaceServer_usermods.sh file. This file is included in WorkspaceServer.sh before SAS is started.

 

db2profile sets environment variables, but SAS reads those from its own environment block, which is set immediately at startup. Running the db2profile from within SAS does not change this environment block.


 

 

Thanks!

Contributor
Posts: 28

Re: Enabling DB2 access in SAS Studio

Posted in reply to KurtBremser

what if we get the same error when running against local server? user has no issue when running remotely but when runningon his own machine giving the error.

 

ERROR: The SAS/ACCESS Interface to DB2 cannot be loaded. The SASDBU   code appendage could not be

       loaded.

ERROR: Error in the LIBNAME statement.

 

SAS/ACCESS Interface to DB2 is installed.

Note: Ealirer the same code was working in 9.3, we have installed 9.4 on user's machine then issue started when running code locally.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 654 views
  • 0 likes
  • 4 in conversation