Hello team,
I have a libname definition as:
libname xabc "&abcref.
I can't figure out how this libname is defined as this. This libname is not a call to a macro which is already defined.
In addition to that there is other libnames are defined above this:
libname xabc "&abcref."
How can we define a libname as above?
Respectfully,
blueblue
@GN0001 wrote:
Hello team,
I have a libname definition as:
libname xabc "&abcref.
I can't figure out how this libname is defined as this. This libname is not a call to a macro which is already defined.
In addition to that there is other libnames are defined above this:
libname xabc "&abcref."
How can we define a libname as above?
Respectfully,
blueblue
Not actually sure what your question is.
If the macro variable used as above the library may be created based on system settings. There is a SAS system option DLCREATEDIR that will create directory for a library if it does not already exist, which is set on my system.
See the log bit below from my system.
167 libname myref "&abc."; WARNING: Apparent symbolic reference ABC not resolved. NOTE: Library MYREF was created. NOTE: Libref MYREF was successfully assigned as follows: Engine: V9 Physical Name: C:\Users\Owner\&abc.
The macro variable does not exist so there is no name to resolve. Therefor SAS is using the current working directory and created a folder named &abc (which I will delete very soon).
The working directory may change, read your log.
If the option is off then there is no library created:
170 options dlcreatedir=off; 171 libname newlib "&pdq."; WARNING: Apparent symbolic reference PDQ not resolved. NOTE: Library NEWLIB does not exist.
Make sure that your macro variable contains a valid path to folder before running the LIBNAME statement.
Or don't run it at all if the variable isn't defined.
There is at least two things wrong with this statement -libname xabc "&abcref.
Here is the same statement with the missing syntax (double quote and semicolon) added: libname xabc "&abcref.";
You also need to the macro variable &abcref defined somewhere, possibly like this: %let abcref = <a valid folder path>;
And respectfully you should be looking at the LIBNAME documentation to confirm if you have the correct syntax or not.
In addition to the error pointed by @SASKiwi , the macro abcref needs to be defined prior to being called.
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.