Date: Tue, 20 Feb 2007 18:59:59 -0500
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Creating a SAS Dataset from Excel
Roland,
Would something like the following data step meet your needs?
PROC IMPORT OUT= WORK.have
DATAFILE= "s:\drugnames.xls"
DBMS=EXCEL2000 REPLACE;
getnames=no;
RUN;
data want (keep= DrugName Code);
set have;
retain getdata;
if getdata then do;
if substr(F1,1,9) eq 'Comments:' then stop;
else if trim(f1) ne '' then do;
DrugName=F1;
Code=F2;
output;
end;
end;
if substr(F1,1,9) eq 'Drug Name' then getdata=1;
run;
Art
---------
On Tue, 20 Feb 2007 14:38:35 -0500, Roland Rivers <seatedcoin@GMAIL.COM>
wrote:
>Basically I just want to strip off the extraneous information in the Excel
>spreadsheet and create an output SAS dataset containing drug names and
>codes.
|