Actually my total Query is data cont; input ID $ Indi $ date: mmddyy10.; datalines; 001 Green 02/23/2001 001 Black 02/24/2001 001 Green 03/18/2000 002 Green 01/19/2021 002 Green 02/19/2012 003 Red 01/11/2000 004 Black 02/12/2021 ; run; proc sql; create table cont as select ID, sum(case when Indi ="Green" then 1 else 0 end ) as Green_count, sum(case when Indi ="Red" then 1 else 0 end ) as Red_count, sum(case when Indi ="Black" then 1 else 0 end ) as Black_count, sum(case when Indi ="Orange" then 1 else 0 end ) as Orange_count from cont group by id; quit; /* my business some times require a query like this */ data check; set cont; by id; if Green_count> 1; run; My Question here is like how I am using if condition from the sql results , can i also query the same from proc freq results .
... View more