SAS day 49:
Where doing safety analysis, sometimes we need to look into the drug relations with Special Interest Adverse Events, which are similar, such as “Glaucoma” and “Glaucosis”.
While investigating into these special interest events, instead of using AESI in (“x”, “y”,”z” ) we prefer a more robust way.
Where.. Like.. this expression can generate similar outputs.
data a; set b; where x like "y%"; run;
Brand begins with A
*1.Brand begins with A; data begin_a; set cars; where Make like "A%"; run;
2.Brand begins with A followed by 3 characters
data begin_a; set cars; where Make like "A___"; *follow by 3 characters; run;
3.letter in between
data twodoor; set cars; where model like "%2dr%"; run;
4.In the end
data car_end; set cars; where make like "%t"; run;
data car_end; set cars; where make like "%t" and model like "%2dr%" ; run;
Proc SQL works well,too.
create table a
select x where y like “a%” from data;
Happy SAS Coding!