DATA Step, Macro, Functions and more

proc import not working for excel files

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

proc import not working for excel files

Im using SAS 9.0 for practicing SAS tutorials.. as im trying to import .xlsx file using proc import but it shows log error.... I'd written something like...
Proc import datafile="C:/desktop/data.xlsx
Out=work.sample
Dbms=xlsx
Replace;
Getnames=yes;
Run;
Im using bit old sas version...is this a reason for showing error... If it is so then plz give me a solution for this so that i can import excel file easily...
Thanks in advance..

Accepted Solutions
Solution
‎02-11-2017 03:12 AM
Super User
Posts: 6,936

Re: proc import not working for excel files

In Excel, select File - Save as, and then the proper file format. Or use File - Export.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 6,936

Re: proc import not working for excel files

[ Edited ]

9.0 is really very old and lacks any support for the newer xlsx format. The simplest ways is to save the Excel data as csv and import that with a data step.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 19

Re: proc import not working for excel files

I'd also done the same...just changed the extension of file from .xlsx to .csv but didn't worked out for me...is there any other possible solution for this..?
Super User
Posts: 6,936

Re: proc import not working for excel files

Just renaming the file does nothing to change its contents and format. Save as csv from Excel.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 19

Re: proc import not working for excel files

How to do it..?
Solution
‎02-11-2017 03:12 AM
Super User
Posts: 6,936

Re: proc import not working for excel files

In Excel, select File - Save as, and then the proper file format. Or use File - Export.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 261 views
  • 0 likes
  • 2 in conversation