I have a dataset where I need to make sure that each like ID gets assigned the same Value. It's not so much that I need to select a specific value to repeat from all that are assigned to the like ID, but that I need all the like IDs to have the same Value.
Data Have:
Id Value
101 656
101 756
101 805
101 752
501 999
502 405
502 365
Suppose you had the chosen values in a dataset have2 (completely made up based on the values you're displaying):
ID Selected
101 656
501 999
502 999
Then a PROC SQL left join will do the trick:
proc sql;
select t1.id, t1.value, t2.selected
from have as t1 left join have2 as t2
on t1.id = t2.id;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
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!