SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
scorbett
Calcite | Level 5

ERROR: Unable to load oracle client (oci.dll)
ERROR: Error in the LIBNAME statement.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Likely causes:

  • You don't have the Oracle client installed on this machine
  • or, you have an Oracle client installed but it's maybe the 32-bit version and you're running 64-bit SAS, so you need the 64-bit Oracle client
  • or, you have the client(s) but the environment PATH variable doesn't have the Oracle paths included so the SAS process cannot find it.
  • or, a variation on the above, you do have it in the PATH variable but the wrong version (32-bit) is ahead of the one you need (64-bit).

Check your PATH variable here (on Windows):

Go to Start button > Search > Enter Environment > Select Edit the System Environment variables > Click Environment Variables button->  In System variables, find PATH.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

7 REPLIES 7
ChrisHemedinger
Community Manager

You haven't shared much detail here. It's possible that your PATH or other environment variables aren't set to find the Oracle client libraries. Usually that's an administrator / config task to set up.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
SASKiwi
PROC Star

Please post the LIBNAME statement you are using. Despite rumours to the contrary we aren't good at guessing what is in statements based on the errors produced....

 

Is this a first time error or has it just started happening?

scorbett
Calcite | Level 5

Has worked before but this is the first time running it on a new computer.

 

1 libname PHI_RES oracle user=scorbett
2 password=XXXXXXXXXXXXXXXX
3 path=KSPHI
4 schema=PHI_RESEARCH
5 oracle_73_or_above=YES
6 preserve_col_names=YES
7 preserve_tab_names=YES
8 dbindex=NO;
ERROR: Unable to load oracle client (oci.dll)
ERROR: Error in the LIBNAME statement.

 

ChrisHemedinger
Community Manager

Likely causes:

  • You don't have the Oracle client installed on this machine
  • or, you have an Oracle client installed but it's maybe the 32-bit version and you're running 64-bit SAS, so you need the 64-bit Oracle client
  • or, you have the client(s) but the environment PATH variable doesn't have the Oracle paths included so the SAS process cannot find it.
  • or, a variation on the above, you do have it in the PATH variable but the wrong version (32-bit) is ahead of the one you need (64-bit).

Check your PATH variable here (on Windows):

Go to Start button > Search > Enter Environment > Select Edit the System Environment variables > Click Environment Variables button->  In System variables, find PATH.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
scorbett
Calcite | Level 5

It appears I have Oracle - OraClient12Home1 and Oracle - OraClient12Home1_32bit.  But I need to have _64bit?

 

ChrisHemedinger
Community Manager

I'm guessing your SAS is 64-bit version. Your Oracle client that SAS loads, which it will find in your PATH, must also be 64-bit.

 

SAS Tech Support can help. This diagnostic program (run and save the log) can provide a lot of good information to solve it quickly. I'm assuming you're running this with SAS for Windows.

 

%put Site: &syssite    Release: &sysvlong    System: &sysscp &sysscpl;    %put &sysuserid;
%let SASROOT=%SYSGET(SASROOT);
%put %quote(&SASROOT);
 %macro doit(command);
   filename p pipe &command lrecl=32767;
   data _null_;
   infile p;
   input;
   put _infile_;
   run;
 %mend;

option LS=256;

%doit("set");
 * windows only;
 %doit("dir ""&SASROOT\access\sasexe\sasio*""");
 %doit("reg query ""HKLM\Software\Oracle"" /s");
 %doit("reg query ""HKLM\Software\Wow6432Node\Oracle"" /s");
 %put %quote(%sysget(PATH));

libname oralib oracle user=orauser password=orapass path=orapath;
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 7 replies
  • 3115 views
  • 2 likes
  • 4 in conversation