Hi Everyone
I have created this table, however what i need is the "Status" to be "Not Verified" for all, if one of them is "Not Verified" for the same name.
Current Table:
| Name | rule | status |
| abc | not verified | not verified |
| abc | verified | verified |
| abc | verified | verified |
| abc | verified | verified |
What i am ideally looking for is:
| Name | rule | status |
| abc | not verified | not verified |
| abc | verified | not verified |
| abc | verified | not verified |
| abc | verified | not verified |
Thank you
proc sql;
create table want as
select name, rule,
case when (name in (select name from have where rule='not verified'))
then 'not verified' else 'verified' end as status
from have;
quit;
proc sql;
create table want as
select name, rule,
case when (name in (select name from have where rule='not verified'))
then 'not verified' else 'verified' end as status
from have;
quit;
If your data are sorted by name then it's straighforward:
data want;
merge have
have (keep=name status where=(status='not Verified'));
by name;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.