Hello,
I want to create a single libname statement that works for my database(via authdomain) and also on my unix server.
I have this:
This works:
%let x=DB2 dsn="ABCDEF" authdomain='abc_d_efg' schema="nameofschema";
libname input &x.; /* No quotes*/
I can also have:
%let x=/path/on/unix/server/directory;
The above libname(WITHOUT) quotes will not work.
For this i will have to ADD the quotes.
This will work for second example:
libname input "&x.";
I need help with handling quotes.
Please advise, in what way i should code this. So that a single libname works for both.
Thanks
Simple answer:
%let x="/path/on/unix/server/directory";
More complex and but much more flexible answer as you can tweak ad infinitum:
libname %sysfunc(ifc(%index(%superq(x),DB2),%superq(x),"&x")) ;
Simple answer:
%let x="/path/on/unix/server/directory";
More complex and but much more flexible answer as you can tweak ad infinitum:
libname %sysfunc(ifc(%index(%superq(x),DB2),%superq(x),"&x")) ;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.