How to import an Excel file into SAS?

Aides1 -  
 gab -
Hello,

I have an Excel file that contains data from a study. I would like to import this file into SAS in order to modify it and perform related statistical analyses. However, I am having trouble importing this data (this file).

Can someone help me with the program to enter in SAS please?

I should note that I am working on my personal PC with Windows XP and I have installed version 9.2 of SAS.

My Excel file is named "base" and is located on my PC in the following directory: D:\Films Dorin\SAS\Travail SAS

What program should I enter in SAS for the "Libname" and "Data" steps?

Thank you in advance for your reply.

2 réponses

gab
 
Hello

to import Excel data into SAS format, you need to use the proc import:
proc import datafile="D:\Films Dorin\SAS\Travail SAS\base.xls" out=base dbms=xls replace; getname=yes; run;

your table will then be created in your work.
see you+
9
Aides1
 
thank you dear Gab,

but unfortunately, while entering the program as you proposed, I received the following messages in my SAS log. the 1st one is in red and the 2nd one in blue.

ERROR: File used, D:\Films Dorin\SAS\Travail SAS\base.xls.
NOTE: The SAS System has stopped processing this step due to errors.

So I keep wondering what was missing!
0
gab
 
Try to close your Excel file before launching the import procedure.
a+
1