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 (April 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 30 Apr 2003 13:25:10 -0700
Reply-To:   Wei <wei112@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Wei <wei112@HOTMAIL.COM>
Organization:   http://groups.google.com/
Subject:   Re: creating new observations in data step
Content-Type:   text/plain; charset=ISO-8859-1

A miner change to Edward Heaton's solution. In case you already have a dataset and each time the number of classes is different.

HtClass: will include all variables start with HtClass, that is: HtClass1, .... HtClass85....

data Yourset; Input PlotId $ Species $ Count HtClass1 HtClass2 HtClass3 HtClass4 ; datalines; xxx Sx 5 2 2 1 . ;

Data test( keep= PlotId Species HtClass ) ; set YourSet; Array ht [*] HtClass: ; Do i=1 to dim(ht) ; If not missing(ht[i]) then do j=1 to ht[i] ; HtClass = i ; Output ; End ; End ; run;


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