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 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 25 Apr 2007 15:04:20 -0500
Reply-To:     baogong jiang <bgjiang@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         baogong jiang <bgjiang@GMAIL.COM>
Subject:      Re: How to do this without using Arrays
Comments: To: SAS_learner <proccontents@gmail.com>
In-Reply-To:  <c2192a610704251235q7c7fb6f7i6d3a3bd93b4b76a8@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

How about:

reason=compress((Duration <*10*)||(Duration >*60*)**2*||(Volume <*90*)**3*||(Volume >*110*)**4*||(infusions<*3*)**5*,*0*); regards,

baogong

On 4/25/07, SAS_learner <proccontents@gmail.com> wrote: > > hello guys, > > I need to something like this my variable "reason" has values 1 to 5 > > 1=Duration <10 min > > 2=Duration >60 min > > 3=Volume <90ml > > 4=Volume >110 ml > 5=< 3 infusions > > if all the condtions are met reason = 1, 2, 3 , 4 , 5. If one of them is > missing they I need the result to be (for ex 3 and 4 is missing ) it > should > be reason = 1,2,5 ; For this I have solution using arrays l something ike > this > > array acnn[*] acntak1-acntak6; > array acnt[*] $150 acntak1_n acntak2_n acntak3_n acntak4_n acntak5_n > acntak6_n; > > reason = ''; > do _i=1 to dim(acnt); > if not missing(acnn[_i]) then do; > acnt[_i] = put(acnn[_i], acn.); > if missing(acn_tak) then reason = acnt[_i]; > else reason = trim(acn_tak)||', '||acnt[_i]; > end; > end; > drop _i; > run; > > but I am looking for something without using Arrays is that possible any > Ideas > > thanks all for your time and help >

-- Baoogng Jiang Department of Agronomy Lousisana State University


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