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.
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!
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.