```Date: Wed, 25 Apr 2007 15:04:20 -0500 Reply-To: baogong jiang Sender: "SAS(r) Discussion" From: baogong jiang Subject: Re: How to do this without using Arrays Comments: To: SAS_learner In-Reply-To: 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 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