LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Roland Rivers <seatedcoin@GMAIL.COM>

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.


Back to: Top of message | Previous page | Main SAS-L page