BookmarkSubscribeRSS Feed
helloSAS
Obsidian | Level 7

Hi,

I'm trying to use proc import as below and I'm getting an error. I'm guess its because i do not have SAS/ACCESS interface to PC files.

PROC IMPORT
DATAFILE='/uhome/snoone/callrecording.xls'
DBMS=EXCEL
OUT=x
REPLACE; run;

ERROR: DBMS type EXCEL not valid for import.

What is an alternative way of importing excel file?

4 REPLIES 4
snoopy369
Barite | Level 11

I don't recall if DBMS=XLS requires access to PC Files, you could try that.  Otherwise you're probably out of luck for XLS.  XLSX can be read in as a text file, given some work (it's a zipped XML file), but odds are it's cheaper to license Access to PC Files.

ballardw
Super User

If you don't have access to PC files you may be best off with saving the file to CSV. Then you can either write Proc Import for that file or use the wizards.

One big, at least in my opinion, of using the CSV approach is that Proc Import generates basic datastep code, look in the log or use F4 key in the editor to recall. The code can be modified to control variable types, informats and formats including using custom informats/formats. I also usually add labels to the code.

snoopy369
Barite | Level 11

If you're referring to Gady's post, that very likely only would work on XLSX (I wrote roughly the same thing a year ago, and FriedEgg wrote a simpler routine as well).  XLSX is an xml file, XLS may be a binary file (it also may be a very differently structured XML file).

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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