BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bwalsh1
Calcite | Level 5

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. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

5 REPLIES 5
Ksharp
Super User
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.

Kurt_Bremser
Super User

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.

bwalsh1
Calcite | Level 5

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.

bwalsh1
Calcite | Level 5

That did the trick.


@Kurt_Bremser 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!

avinashginjupal
Obsidian | Level 7

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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