BookmarkSubscribeRSS Feed
rli7
Calcite | Level 5

Hi,

 

I am trying to complete the following activity in SAS Programming Essentials: Accessing Data but am unable to map the Excel file from my drive onto SAS Enterprise Guide:

 

Write a LIBNAME statement to create a library named NP that reads np_info.xlsx in the course data as follows:

  • SAS Studio: Specify the full path to your EPG194/data folder and the complete file name.
  • Enterprise Guide: Specify &path and the complete file name.

 

libname np xlsx "C:/Users/574026662/Documents/SAS documents training/coursedata/EPG194/data/np_info.xlsx";

 

It keeps saying that it cannot read or map the file, which is strange because I've specified the exact file path.

 

Can someone help?

 

Thanks. 

5 REPLIES 5
unison
Lapis Lazuli | Level 10

Are you connecting remotely to a sas server? Try checking a few of the system macro variables like:

%put &=sysscpl &=userdir;
-unison
rli7
Calcite | Level 5

Hi, 

 

It says SYSSCPL=AIX userdir

 

WARNING: Apparent symbolic reference USERDIR not resolved.

Tom
Super User Tom
Super User

@rli7 wrote:

Hi, 

 

It says SYSSCPL=AIX userdir

 

WARNING: Apparent symbolic reference USERDIR not resolved.


Does the C: prefix on a filename really work on system running the AIX unix operating system?  Are you sure you haven't given it the path on your local PC instead of the path on the machine where SAS is running?

newfee
Fluorite | Level 6

Hi.

Does you libname statement work if you leave out the first xlsx? (the xlsx immediately after np)

Cynthia_sas
SAS Super FREQ
Hi:
For this exercise, they are using the XLSX libname engine. So the XLSX after the NP in the LIBNAME statement is necessary. My guess is that the problem is related to how the student is using SAS.
For example, if the student is using SAS University Edition in a Virtual Machine and if they followed ALL of our instructions, then the path to the file should be:
libname np xlsx "/folders/myfolders/EPG194/data/np_info.xlsx";

and for SAS OnDemand for Academics would be:
libname np xlsx "/home/<userID>/EPG194/data/np_info.xlsx";

But if the student is using Enterprise Guide to connect to SAS on a Unix server, then their location should be in the WORK folder which can be referenced (assuming they followed all of our instructions) with this LIBNAME statement:
libname np xlsx "&path/np_info.xlsx";

So without more information about how they are using SAS, it's hard to provide more constructive suggestions.

The other reason it might not be able to read the file is if there is some spelling error or file name issue. Unix is sticky about file names so the strings 'ABCDE' and 'AbCdE' and 'abcde' in a file path on Unix would denote 3 different locations.
Another possible issue is that the student did not actually make the files correctly. For example, if SAS on their server does not have the XLSX engine installed (because it's an older version of SAS), then there's a chance that they made some but not all of the class files.
Sorry I can't be of more help.
Cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 652 views
  • 1 like
  • 5 in conversation