Hi I simply want to keep only data with centain qualities. Can somebody spot the mistake? I don't understand why my code gives me a totally wrong output. Data Kea.Trails1b(COMPRESS = YES REUSE = YES);
length DIVISION_COUNTY_NME $30;
format DIVISION_COUNTY_NME $30.;
If DIVISION_COUNTY_NME in ('Denver','Douglas','Arapahoe', 'Jefferson', 'Adams', 'Bromfield', 'Elbert', 'Park',
'Clear Creek','Gilpin', 'Larimer' )
THEN COUNTY = "yes" ;ELSE COUNTY = "no";
Set Kea.Trails1a;
run; I read it is easier to introduce a new variable and then delete the records with that specific variable pattern. So here I want to keep records with the Counties: 'Denver','Douglas','Arapahoe', 'Jefferson', 'Adams', 'Bromfield', 'Elbert', 'Park', 'Clear Creek','Gilpin', 'Larimer' they shoud all become COUNTY = "yes" ; Why is this not happening?? Please see screenshot below.
... View more