libname np xlsx "/home/rachelgabbard0/EPG194/data/np_info.xlsx";
/* Enterprise Guide: */
libname np xlsx "&path/np_info.xlsx";
this is my code and this is the warning I get
WARNING: Apparent symbolic reference PATH not resolved.
I am in the essentials course and am trying to learn SAS for work.
Hello,
&path -- This is referencing a macro variable, you need to learn about macros in SAS.
Macro variable 'path' has to be defined first in order to reference it later.
For example:
%let path = /home/rachelgabbard0/EPG194/data;
options symbolgen;
libname np xlsx "&path/np_info.xlsx";
Here the Symbolgen option will tell you the values that was replaced in place of the macro reference in log.
In log:
SYMBOLGEN: Macro variable PATH resolves to /home/rachelgabbard0/EPG194/data
This means &path was replaced by /home/rachelgabbard0/EPG194/data
&path in this case is a macro variable
However, the error message indicates that macro variable &path does not exist, and so it can't be used.
Thus you have to give &path a value (it's probably a folder name where the Excel file np_info.xlsx is stored). So on my computer, I could use this line of code at the start of my program:
%let path=c:\users\pmiller\documents;
Naturally, your value for path will be different.
Hello,
&path -- This is referencing a macro variable, you need to learn about macros in SAS.
Macro variable 'path' has to be defined first in order to reference it later.
For example:
%let path = /home/rachelgabbard0/EPG194/data;
options symbolgen;
libname np xlsx "&path/np_info.xlsx";
Here the Symbolgen option will tell you the values that was replaced in place of the macro reference in log.
In log:
SYMBOLGEN: Macro variable PATH resolves to /home/rachelgabbard0/EPG194/data
This means &path was replaced by /home/rachelgabbard0/EPG194/data
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.