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

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 4078 views
  • 0 likes
  • 3 in conversation