• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

A very basic SAS question

BoredBloke

Godlike
Thanks received
41
OK I am just embarking on SAS so this is at a very low level.

I'm trying to import an excel file into SAS but keep getting an error relating to the DBMS line

'ERROR: DBMS type EXCEL not valid for import.'

The book I'm using suggests this

PROC IMPORT DATAFILE="C:\SAS Data\disk\data\tnfdata.xls"
OUT=tnfdata
DBMS = excel97
REPLACE;
SHEET="TNFdata";
GETNAMES=YES;

PROC PRINT DATA=tnfdata;


but I keep getting 'ERROR: DBMS type EXCEL97 not valid for import.'

I have tried changing the Excel 97 to 2000, 2002, 2003, 03, leaving ity out, XLS and still geep getting the same type of error. What the hell am I doing wrong with this. From looking on the net, the sytax suggested in the book should work but fails on my copy.
 
Last edited: 22:49
Yes it is closed

Each time I run it I get

"ERROR: DBMS type EXCEL not valid for import."

Where EXCEL = whatever type of Excel I specify

I have tried dbms = Excel, Excel 97, XLS, Excel2003, Excel03 and others.

All give this dbms error.
 
Have you got the SAS-ACCESS PC File Formats module installed? Base SAS wont import/export to PC files without it.
 
I can import/export manually but not via code. It also failed on the script using the delimited file.

I am only using the learning edition so I will check to see if there are any extra things which need to be installed.

Where do you look for the extra bits to load?
 
Last edited: 19:29
Try this

proc setinit; run;

then look for SAS/ACC-PC File Formats as one of the listed modules.

If you cant find it you need to reinstall SAS and make sure it's selected as a mosule to install.

If it is there then have a look under file menu > Import Data and see what formats are available. If access and excel arn't there then you need to reinstall a above.

Other than that have you tried importing the data from a csv file?
 
DaveB said:
Try this

proc setinit; run;

then look for SAS/ACC-PC File Formats as one of the listed modules.

If you cant find it you need to reinstall SAS and make sure it's selected as a mosule to install.

If it is there then have a look under file menu > Import Data and see what formats are available. If access and excel arn't there then you need to reinstall a above.

Other than that have you tried importing the data from a csv file?

The Learning Edition is unlikely to have the File Formats module installed.
You will have to do it manually (you know, the old-fashioned way, by writing code :D ). The INPUT statement allows you to read from csv and the PUT statement writes csv files.
 

Advertisers

Back
Top