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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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