Learning SAS? Welcome to the exclusive online community for all SAS learners.

Importing Excel file to SAS Studio

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Importing Excel file to SAS Studio

Is there a student-friendly way to import Excel data into SAS Studio for data analysis?


Accepted Solutions
Solution
‎05-18-2015 11:14 AM
SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

Please see if this helps:

View solution in original post


All Replies
Super User
Posts: 17,824

Re: Importing Excel file to SAS Studio

Is it SAS On Demand or SAS University Edition?

Occasional Contributor
Posts: 7

Re: Importing Excel file to SAS Studio

University Edition, SAS Studio

Occasional Contributor
Posts: 7

Re: Importing Excel file to SAS Studio

And I am using a Mac, so the file paths may not be the same?

SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

The file paths won't be in the same format, but if you select the folder in the Finder and then do a "Get Info" by doing a Control-click, you'll see in the "Get Info" box the "Where:" field. You can use this path to set up your Shared Folder. Once it is in your Shared Folder, you can assign a libname, etc., based on its location in the VM. In other words, the Linux VM for University Edition is the same whether on a PC or Mac.

I hope this makes sense but let me know if not.

Occasional Contributor
Posts: 7

Re: Importing Excel file to SAS Studio

I set up my shared folders in VMware Fusion when I downloaded all the files.  So the Excel file is already in that shared folder.  The problem is that when I put that path in for the IMPORT snippet, it doesn't recognize it.  I typed FILENAME="/documents/SAS University Edition/my folders/workbook2.xlsx"

That the is path for the shared folder that I created.

Occasional Contributor
Posts: 7

Re: Importing Excel file to SAS Studio

Thanks, Randy.  You are so helpful, and that does makes sense, and I revised my path to

PROC IMPORT DATAFILE="/Users/henryrn/Documents/SAS University Edition/my folders/workbook2.xlsx"

after using the "get info" function.  I still get an error message saying 

ERROR: The path /Users/henryrn/Documents/SAS University Edition/my folders/workbook2.xlsx is invalid because it is not in the list

  of accessible paths when SAS is in the lockdown state.

Yes, I have watched tutorials and followed the link above about accessing data in SAS.  It is full of libref and library names references.  I think the big picture in all of this is reflected in my original question, "Is there a student-friendly way to import Excel data into SAS Studio?"  I cannot imagine having to trouble-shoot this with 50 students this fall!  I am coming to the conclusion that this will not work for them.  I was hoping for a good solution for them for using SAS Studio off-campus since most of them have Macs.  They will have to continue to do their work on campus using SAS Enterprise Guide if I can't get this option to work. 

Thanks for your patience and good suggestions!

SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

Hi, LUstatsprof. Let me take a look and get back to you...shouldn't be long.

SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

I just did the following on my Mac:

1. Dropped an Excel (.xlsx) file called "ProjectPlanningChecklist.xlsx" into my Shared Folder.  The Shared Folder location on my Mac is /Users/rmullis/Documents/myfolders. When I check the Properties of this file (as viewed in SAS Studio) the path is /folders/myfolders/data/ProjectPlanningChecklist.xlsx  (see screen capture)

properties.png

2. Ran this code:

PROC IMPORT DATAFILE="/folders/myfolders/data/ProjectPlanningChecklist.xlsx"

     OUT=WORK.checklist

     DBMS=XLSX

     REPLACE;

RUN;

PROC PRINT DATA=WORK.checklist; RUN;

This worked fine. Have you tried this?

Occasional Contributor
Posts: 7

Re: Importing Excel file to SAS Studio

It worked!  Thank you so much!  I was trying to use the Mac path instead of the one from SAS.  This is very helpful!  Thanks for taking the time to send this!

SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

Good to hear! Thank you for using SAS!

Occasional Learner
Posts: 1

Re: Importing Excel file to SAS Studio

Hi

 

I wonder how can I upload excel file, which are not in sas library or sas dlders? it is just excel file on my laptop. 

Is it possible to add files from outside to be in sas folders or sas library?

 

 

Solution
‎05-18-2015 11:14 AM
SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

Please see if this helps:

SAS Super FREQ
Posts: 361

Re: Importing Excel file to SAS Studio

One other thing: If, like me, you need the big picture in order to put it all together, here's an article that is a step back and covers access data in SAS University Edition as a general topic:

How do I access data in SAS?

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 13 replies
  • 2558 views
  • 1 like
  • 4 in conversation