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

How to Import Microsoft Excel2013 file into SAS university edition

Reply
Occasional Contributor
Posts: 11

How to Import Microsoft Excel2013 file into SAS university edition

Hi, 

 

I am trying to import Excel 2013 file into SAS university edition. Iam using Windows 10 platform

 

Code that I have written:

proc import datafile='C:\Kaushik\Sas University\My Folders\Sample.Xls'
DBMS=Xls out=kaushik;
Sheet="SampleData";
run;

 

Log that I am encountering:

 

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 proc import datafile='C:\Kaushik\Sas University\My Folders\Sample.Xls'
63 DBMS=Xls out=kaushik;
64 Sheet="SampleData";
65 run;
 
ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\Kaushik\Sas University\My Folders\Sample.Xls.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
66
67 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
80
 
Please help
Frequent Contributor
Posts: 104

Re: How to Import Microsoft Excel2013 file into SAS university edition

Hi,

Check your data path, your sheet name and try this:

 

PROC IMPORT DATAFILE='C:\Kaushik\Sas University\My Folders\Sample.Xls'
            DBMS=EXCEL
            OUT=kaushik replace;
            SHEET="SampleData";
            MIXED=yes;
RUN;
________________________

- Cheers -

Super User
Posts: 6,964

Re: How to Import Microsoft Excel2013 file into SAS university edition

UE runs in a Linux virtual machine, so you have to use UNIX file- and pathname syntax for files in your shared folder.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
PROC Star
Posts: 7,364

Re: How to Import Microsoft Excel2013 file into SAS university edition

With SAS UE you'll want to use:

 

proc import datafile='/folders/myfolders/sample.xls'

 

however, it is case sensitive (I think) thus you may have to adjust the file name to how it is stored on your computer

 

Art, CEO, AnalystFinder.com

 

Super User
Posts: 17,912

Re: How to Import Microsoft Excel2013 file into SAS university edition

1. SAS UE doesn't interact with your desktop EXCEPT through the shared folders you set up, such as myfolders in the set up instructions. 

2. Because you're working with a Unix VM you need to use Unix path names and the path mapped, not the C:\ path. As mentioned this case sensitive.

3. You say Excel2013 file but your extension is XLS. XLS files are not Excel2013. 

 

This is what your code should look like:

 

proc import datafile='/folders/myfolders/Sample.xlsx'
DBMS=XLSX out=kaushik REPLACE;
Sheet="SampleData";
run;

Please review topics under the Analytics U forum for further help with these types of questions as they are ALL answered there, including how to set up your own shared folder, accessing an Excel file, creating libraries and permanent data set. If that's not helpful, see the training video's or the SAS Analytics U help center.

 

I'm moving this question to the Analytics U forum. 

 

support.sas.com/training/tutorial

https://support.sas.com/software/products/university-edition/faq/main.htm

 

 

 

Ask a Question
Discussion stats
  • 4 replies
  • 203 views
  • 2 likes
  • 5 in conversation