Desktop productivity for business analysts and programmers

Import only spreadsheet from .xls to sas

Reply
N/A
Posts: 0

Import only spreadsheet from .xls to sas

Hi! I've a problem.
I need to import unified excel files to sas using standart import procedure (range of rows, columns' formats etc.)
But if save the code I can operate with native file, not others.
If I edit code pointing another file, how can I point exact spreadsheet?

INFILE "D:\path\test.xls"
DELIMITER='*'
MISSOVER
DSD
I
SAS Super FREQ
Posts: 8,719

Re: Import only spreadsheet from .xls to sas

Hi:
With the IMPORT procedure: http://support.sas.com/kb/5/458.html
[pre]
proc import datafile="c:\myfiles\Accounts.xls"
out=sasuser.accounts;
sheet="Prices";
getnames=no;
run;

proc print data=sasuser.accounts(obs=10);
run;

[/pre]

But, your code snippet shows the MISSOVER option -- which is not relevant to PROC IMPORT. If you are using ODBC or DDE, the syntax is shown below:

Libname Engine: http://support.sas.com/kb/12/628.html
[pre]
libname mylib odbc dsn=Excel;

proc print data=mylib.'This Sheet$'n; run;

data mylib.new;
set mylib.'This Sheet$'n;
run;
[/pre]


DDE: http://support.sas.com/kb/2/929.html
[pre]
filename fileref dde 'Excel|[Book1]Sheet1!R1C1:R1C5';
infile filref missover dsd notab dlm='09'x;
input a b c d e;
run;
quit;
[/pre]

If you are still having problems with your program, your best bet for help is to contact Tech Support.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 105 views
  • 0 likes
  • 2 in conversation