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 (December 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 20 Dec 2008 06:02:51 -0800
Reply-To:     JianAn Lu <loginon@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         JianAn Lu <loginon@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: transpose using array
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

how about transpose approach, in that case you don't have to hardcode arount 'lbtest'

data have; input pt lbtest $ value lbunits $; cards; 101 ht 174 cm 101 wt 85 kg 101 xx 30 kg/m2 102 ht 184 cm 102 wt 93 kg 102 xx 29 kg/m2 103 wt 70 kg 103 ht 150 cm ;

data have; set have; format units $7.; units = trim(lbtest)||'units'; run;

proc transpose data = have out=havev(drop = _name_) ; by pt; id lbtest; var value; proc transpose data = have out=haveu (drop = _name_); by pt; id units; var lbunits;

data havet; merge havev haveu; by pt; run;


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