BookmarkSubscribeRSS Feed
vThanu
Calcite | Level 5

I want to read an excel file into SAS environment (Server) which is saved on my windows desktop (using proc step or data step).

 

Can it be possible? how?

 

 

 

Thanks in advance... 

5 REPLIES 5
Kurt_Bremser
Super User

You have to save any data that you want to import into SAS with SAS code only (no use of Enterprise Guide import wizards) to a location that is "visible" from the context of the SAS session.

You can do that by

  • using a shared location mounted both on your desktop and server
  • setting up a share on your desktop that is accessible by the server
  • copying the file to the server with a tool like WinSCP

After the file is visible, you can either use proc import or libname excel.

Note, though, that the use of the Excel file format for data interchange is advised against, as you force SAS to make guesses about column attributes; it is recommended to save spreadsheets to text files and read those with a data step, where you have control.

Patrick
Opal | Level 21

@Kurt_Bremser  "no use of Enterprise Guide import wizards"

I thought the SAS EG import wizard uses client side .net to read the Excel and then uploads the data to the server for further processing - or you select in one of the Wizard windows to include the data and then EG creates code with data included. 

 

Kurt_Bremser
Super User

Yes, the conversion from Excel to an intermediate text which is copied to the server happens with help of MS.

But from the OP, I take it that a solution without EG interaction is wanted.

Patrick
Opal | Level 21

@vThanu 

If you've got SAS Enterprise Guide and this is a one off task then use the SAS Import Wizard (File/Import) to read the data from Excel. That's by far the quickest way to do things for simple Excel spreadsheets.

If you need a repeatable and automated solution which also can execute without the SAS EG client then everything @Kurt_Bremser already wrote.

Oligolas
Barite | Level 11

Yes it's possible, did you try the forum's search functionality?

https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545669/highlight/true...

________________________

- Cheers -

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!

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.

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
  • 5 replies
  • 993 views
  • 0 likes
  • 4 in conversation