BookmarkSubscribeRSS Feed
hkotian
Calcite | Level 5
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)
8 REPLIES 8
deleted_user
Not applicable
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;
Cynthia_sas
SAS Super FREQ
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 😎

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

cynthia
hkotian
Calcite | Level 5
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
andreas_lds
Jade | Level 19
> 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.
deleted_user
Not applicable
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
hkotian
Calcite | Level 5
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
hkotian
Calcite | Level 5
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
Bill
Quartz | Level 8
You could save the xl file as a text file and then read it with a sas data step ...

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 8 replies
  • 2222 views
  • 0 likes
  • 5 in conversation