Date: Thu, 19 Feb 2009 11:24:40 -0600
Reply-To: Mary <mlhoward@avalon.net>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mary <mlhoward@AVALON.NET>
Subject: Re: A flaging question - very urgent
Content-Type: text/plain; charset="iso-8859-1"
Tom,
Form a character variable which has the flagged result:
data test;
infile cards missover;
input subject Units class;
cards;
1001 23 30
1002 27 13
1007 29 25
1002 28 18
1007 56 09
;
run;
proc sql noprint;
create table test2 as
select subject,
case when class > 20 then put(units,2.) || '*' else put(units,2.) end as units format $10.,
class
from test;
quit;
-Mary
----- Original Message -----
From: Tom Smith
To: SAS-L@LISTSERV.UGA.EDU
Sent: Thursday, February 19, 2009 11:03 AM
Subject: A flaging question - very urgent
I have the following dataset with 3 variables (subject, Units,class):
subject Units class
------- ----- -----
1001 23 30
1002 27 13
1007 29 25
1002 28 18
1007 56 09
I have to flag the variable Units if the value of the variable class is
greater
than 20:
so the final dataset (result dataset) should be as below:
subject Units class
------- ----- -----
1001 23* 30
1002 27 13
1007 29* 25
1002 28 18
1007 56 09
Thanks you so much