BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aabbccwyt
Obsidian | Level 7

Hi. I'm using the SAS Studio University Edition. How can I import an excel file (name it 2019.xlsx) from my local computer to SAS and use a library to read that xlsx file? What would the codes be? Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@aabbccwyt wrote:

Thank you so much for replying. Is there is a way not to use the shared folder thing? I'm using Macbook btw.


All communication regarding files is done through the shared folder. It is set up explicitly for that.

View solution in original post

7 REPLIES 7
Tom
Super User Tom
Super User

For SAS to see the file you need to put it into (or under) the folder on your real machine that you shared with the virtual machine where SAS is running.  You could just place it there outside of the SAS/Studio interface or use the file upload feature in SAS/Studio interface.

 

Once you have it there you need to know where it is from SAS's point of view.  An easy way to find that is to navigate to the file in SAS/Studio interface and right click on it and select properties. One of the properties is the actual name/path of the file. So copy that and paste it into the code editor window.  Use that to make a libname using XLSX engine. Remember that the name you use for the library (the LIBREF) must be a valid SAS name of 8 character or less.  

 

So this program will point the libref MYLIB at the file and then copy all of the sheets out as datasets in the WORK library.

 

libname mylib xlsx "/folders/myfolders/2009.xslx";
proc copy inlib=mylib out=work;
run;
aabbccwyt
Obsidian | Level 7

Thank you so much for replying. Is there is a way not to use the shared folder thing? I'm using Macbook btw.

Kurt_Bremser
Super User

@aabbccwyt wrote:

Thank you so much for replying. Is there is a way not to use the shared folder thing? I'm using Macbook btw.


All communication regarding files is done through the shared folder. It is set up explicitly for that.

aabbccwyt
Obsidian | Level 7
Thank you so much!
aabbccwyt
Obsidian | Level 7

Here is what I have.

Screen Shot 2019-09-26 at 3.38.38 PM.png

 

Tom
Super User Tom
Super User

Looks like the file is there.  Are you having any trouble?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 4105 views
  • 1 like
  • 3 in conversation