BookmarkSubscribeRSS Feed
u63406443
Calcite | Level 5

Hi All,

 

I am trying to connect with database using libname statement, for that I have created a macro variables and those variables is not fetched in libname statement. Can you all please look into the code and help me resolve the issue.

 

See difference in below two  libname statements in a password field.

code:

%let user=%str(rakesbx);
%let password=%str(rAk%B25%);

/*Libname cdl1 odbc datasrc="cdl2-hive" schema= abv_hcp360_besting_lease_ext user= "&user" password= "rAk%B25%";*/ ---> when I am trying these way and commenting the password variable  it is giving the result i.e.,:

 

Success result is:

 

u63406443_1-1698294331542.png

 


Libname cdl2 odbc datasrc="cdl2-hive" schema= abv_hcp360_opt_preference_ext user= "&user" password= "&password"; ----> when I am trying these way it is not giving the result i.e.,

 

Error result is:

u63406443_0-1698294159428.png

 

Thanks.

 

3 REPLIES 3
rudfaden
Lapis Lazuli | Level 10

Try Using %nrstr() instead of %str(). If you must use %str you need to mask you % signs like this %str(rAk%%B25%%)

u63406443
Calcite | Level 5

Thank you rudfaden, Got it.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 3 replies
  • 1231 views
  • 2 likes
  • 2 in conversation