BookmarkSubscribeRSS Feed
MathapeloPh
Calcite | Level 5

 

How to I resolve the error below?

 

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21
22 GOPTIONS ACCESSIBLE;
23 options validvarname=v7;
24 %let path=\\dpc4-75617d\C$\Users\MathapeloPh\Desktop\Move_9093777\Listing Files\Output_Files_Sent_to_Field;
25
26 libname fieldx xlsx "\\%path\PSUs_Segments_161116.xls";
WARNING: Apparent invocation of macro PATH not resolved.
NOTE: Libref FIELDX was successfully assigned as follows:
Engine: XLSX
Physical Name: \\%path\PSUs_Segments_161116.xls
27
28
29 proc contents data=fieldx._ALL_;
30 run;

WARNING: No matching members in directory.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.03 seconds
cpu time 0.04 seconds

3 REPLIES 3
Kurt_Bremser
Super User

A macro variable needs to be adressed as &name. %name would call a macro.

Try

libname fieldx xlsx "\\&path.\PSUs_Segments_161116.xls";

Also note the dot after the macro variable; this makes sure that the macro processor stops scanning for further characters when building the macro variable name.

MathapeloPh
Calcite | Level 5

Thanks @Kurt_Bremser the libname was successfully assigned. Kindly check the warning below it as I now try to read sheets inside the file:

 

libname fieldx xlsx "\\&path.\PSUs_Segments_161116.xls";
NOTE: Libref FIELDX was successfully assigned as follows:
Engine: XLSX
Physical Name: \\\\dpc4-75617d\C$\Users\MathapeloPh\Desktop\Move_9093777\Listing
Files\Output_Files_Sent_to_Field\PSUs_Segments_161116.xls
27
28
29 proc contents data=fieldx._ALL_;
30 run;

WARNING: No matching members in directory.

Kurt_Bremser
Super User

I guess that happens because proc contents (or the contents statement in the datasets procedure) are meant for SAS datasets.

Try this instead:

proc datasets library=fieldx;
quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1049 views
  • 0 likes
  • 2 in conversation