BookmarkSubscribeRSS Feed
telligent
Quartz | Level 8
I tried two ways.  Using proc import, I can get one sheet if I leave off the sheet=, but with sheet= 
I get ERROR: Couldn't find sheet in spreadsheet.  So, I don't know how to figure out what SAS thinks the sheet names are. 
 
options validvarname=v7;
FILENAME REFFILE FILESRVC FOLDERPATH='/Users/xxxxxxx'  FILENAME='2018_National_Awardees.xlsx';
PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.Awardees_2018;
    sheet='2021  Age and Race-Ethnicity'; 
GETNAMES=YES;
RUN;
 
 
Second, I tried this: 
libname test XLSX "/Users/xxxxxxx/2018_National_Awardees.xlsx";
 
And I get
WARNING: No matching members in directory.
6 REPLIES 6
Kurt_Bremser
Super User

/Users at the start of your path lets me suspect MacOS. SAS does not run on this system.

If you use a Mac with SAS Studio, you have to upload the file first and use the path on the SAS server.

telligent
Quartz | Level 8

The files have been uploaded to SAS studio.  I am still having trouble reading them.  And I am on a Windows 11 machine but working in Viya in the cloud. 

Kurt_Bremser
Super User

Make sure that you use exact spelling for file and path names. Are you sure (e.g.) it is "Users" and not "users"?

UNIX (and therefore Linux) is case sensitive.

Right-click on the file in the SAS Studio navigation window and copy the path from there.

Tom
Super User Tom
Super User

I doubt that the 2021 sheet is in the 2018 workbook.

telligent
Quartz | Level 8
Thank you. That fixed the proc import. The libname method is still not working, so I won't accept solution immediately. I will if I don't get any input on that.
Kurt_Bremser
Super User

When the FILENAME pointing to the file service works, then I doubt that you can create a LIBNAME, as you need a physical path in the operating system's file system for that, which the Viya file service does not provide.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 1349 views
  • 3 likes
  • 3 in conversation