Hi all,
I have a question regarding retrieving data from a large database file. I have data in this format:
num1 num2 num3 A B Unique_obs
1, 1, 1, 100.0, 70.0, -10.5
1, 6, 30, 100.0, 70.0, 23.0
1, 8, 31, 100.0, 70.0, 32.0
1, 1, 1, 105.0, 70.0, -7.5
1, 6, 30, 105.0, 70.0, 22.0
1, 8, 31, 105.0, 70.0, 16.0
1, 1, 1, 110.0, 70.0, -2.0
1, 6, 30, 110.0, 70.0, 12.0
1, 8, 31, 110.0, 70.0, 21.0
and so forth...
Now, I would to retrieve the maximum value of Unique_obs per A and B combination. For example..for the first three rows of the above hypothetical dataset (A=100.0, B=70.0), the max value of the Unique_obs is 32.0; for the rows 4-6 (A=105.0; B=70.0), the max value of Unique_obs is 22.0 and for rows 7-9 (A=110.0; B=70.0), max value is 21.0.
I would like to retrieve the max. value of Unique_obs for each combination of A and B such that SAS selects and outputs the whole row containing the max. value observation (ex: 1, 8, 31, 100.0, 70.0, 32.0). Can anybody offer an advice? Do I use PROC SQL? Thank you.