Hello,
I inherited such code:
/**************************************/
Libname yy2 ' '; /*nothing between the two quotes*/
data yy2;
set ......;
run;
/**************************************/
Rerunning the code is fine, but YY2 shows up empty. Any idea what is going on? I know libname statement can be used in all kinds of fancy way, but EMPTY? The admin and the initial author of the code had some tacit agreement in CFG.... I would like to hear some thoughts to see if this is by design some built in SAS syntax before I chase down somebody. Thanks. Jia
Run
libname yy2 list;
to see where this points. It should be the current working directory of the SAS process, which is in sasconf/Lev1/SASApp in the default configuration.
It is a good way to figure out what the current working directory is for your SAS session, but I would use a period instead of space in the quotes since that is normal syntax for current directory.
Most likely the code is designed to be run from the command prompt.
cd myprojectdir
sas myprogram
Run
libname yy2 list;
to see where this points. It should be the current working directory of the SAS process, which is in sasconf/Lev1/SASApp in the default configuration.
@fierceanalytics wrote:
See. So it is just naming the temp work directory. No wonder there is nothing there. Thanks. Jia
Nope. It is making a libref that points to the current directory. Useful for portable code.
Not sure what operating system you are using but that syntax works fine on Windows and Unix.
1 %put &=sysvlong &=sysscp;
SYSVLONG=9.04.01M5P091317 SYSSCP=WIN
2 libname here ' ';
NOTE: Libref HERE was successfully assigned as follows:
Engine: V9
Physical Name: C:\Users\.......
1 %put &=sysvlong &=sysscp;
SYSVLONG=9.04.01M5P091317 SYSSCP=LIN X64
2 libname here ' ';
NOTE: Libref HERE was successfully assigned as follows:
Engine: V9
Physical Name: /home/....
But it is probably not very useful if you are launching SAS via some GUI tool instead of from the command line. For example if you are launching SAS code using Enterprise Guide, SAS/Studio or even Microsoft Windows. In that case you should come up with another method to locate your datasets.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.