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.
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.
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.
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.
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.
That did the trick.
@Kurt_Bremser wrote:You need to include
. /db2aix/db2inst1/sqllib/db2profilein 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!
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.