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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.