BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rachelgabbard0
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

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

 

Thanks,
Suryakiran

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
SuryaKiran
Meteorite | Level 14

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

 

Thanks,
Suryakiran
rachelgabbard0
Calcite | Level 5
That fixed it. Thank you so much

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3745 views
  • 0 likes
  • 3 in conversation