10-01-2015 12:25 AM
I have two libname statements in the attached code (I only run 1 at a time) that should be the same yet only one works. The direct call-out works but using the macro variable name does not. From what I can tell, these are the EXACT SAME things. When I run the libname using dirSAS I receive an error. Please advise.
*libname libsas 'dirSAS'; *This does not work;
libname libsas '/folders/myfolders'; *This does work;
DLM =','; *Range of, comma delim;
input Season $ Sep Oct Nov Dec Jan Feb Mar Apr May Total;
NOTE: Library LIBSAS does not exist.
10-01-2015 02:45 AM
You have put your directory in a macro variable. Using
libname libsas 'dirSAS';
You are trying to create a libname called libsas of the directory dirSAS(that doesn't exist). To replace the content of a macro variable you must use & before the name of the variable. Furthermore simple quote doesn't allow macro replacement, you must use double quotation marks
libname libsas "&dirSAS";