09-13-2011 01:08 PM
SAS newbie here :-)
I have table similar to this:
I want to extract data and make a new table with only unique IDs with the highest version and corresponding value.
This is may be easy, but I'm new to SAS :-)
09-13-2011 01:27 PM
There are a number of ways. Here is one using proc sort.
proc sort data=have;
by id descending version;
proc sort data=have out=want nodupkey;
09-13-2011 04:50 PM
The data set also appears to be sorted by ID and Version, in which case, you can use:
proc sort data=have; *--- only needed if not already sorted by ID and Version;
by id version;
if last.id; *--- highest version for each id due to sorting;
Use which ever method you find more natural and intuitive to you. Art's methods all work.