Help using Base SAS procedures

PROC IMPORT

Reply
Occasional Contributor
Posts: 12

PROC IMPORT

Does anybody know how to use SASV9 PROC IMPORT options
scantext,scantime,mixed in SAS V8. Is there any alternative procedure/datastep that can be used in SAS to import excel file(.xls)
N/A
Posts: 0

Re: PROC IMPORT

do you have license for SAS/ACCESS - PC? If so,

PROC IMPORT OUT= outfile
DATAFILE= "... excel in file ..."
DBMS=EXCEL2000 REPLACE; *** excel versions;
SHEET="... sheet name ...";
GETNAMES=YES;
RUN;
SAS Super FREQ
Posts: 8,740

Re: PROC IMPORT

Also, if you have SAS 9 and SAS/Access for PC File Formats, then you can also use the SAS Excel Libname engine:
http://support.sas.com/kb/16/176.html has an example of:
[pre]
libname mylib "C:\My Documents\MyFile.xls";

proc print data=mylib.'Sheet1$'n; run;

data sasuser.new;
set mylib.'Sheet3$'n;
run;

[/pre]

and there is other documentation and notes about the LIBNAME engine access to Excel:
http://support.sas.com/kb/13/050.html
http://support.sas.com/kb/13/948.html
http://support.sas.com/kb/4/432.html (note abt SAS 8)

And, there are ODBC or OLE-DB or DDE methods -- but those fall into the non-SAS technology column.

cynthia
Occasional Contributor
Posts: 12

Re: PROC IMPORT

We do have SAS version 9 but we do not have PC file formats installed on the UNIX box, hence the problem.
Is there an alternate way to do this
Super Contributor
Posts: 259

Re: PROC IMPORT

> We do have SAS version 9 but we do not have PC file
> formats installed on the UNIX box, hence the problem.
>
> Is there an alternate way to do this

I think the only way is to export the Excel-Worksheet to csv and import that file by using either proc import or a data step.
N/A
Posts: 0

Re: PROC IMPORT

Okay, do you have SPSS V14 or later? (V13 had some bugs)
In SPSS, from File\Open\data..., use xls type and pick your excel file. Follow some options (data second line, etc). Then from File\Save as ... pick .sas7bdat as file type and save. The SAS dataset is now in your excel folder.

Htun Lynn
Occasional Contributor
Posts: 12

Re: PROC IMPORT

Actually we do not have SPSS either. Is there any way we can programmatically code these sas 9 options in a data step in v8
Occasional Contributor
Posts: 12

Re: PROC IMPORT

Actually we do not have SPSS either. Is there any way we can programmatically code these sas 9 options in a data step in v8
Super Contributor
Posts: 291

Re: PROC IMPORT

You could save the xl file as a text file and then read it with a sas data step ...
Ask a Question
Discussion stats
  • 8 replies
  • 1013 views
  • 0 likes
  • 5 in conversation