I want to update value of one column in an existing table by some condition. Please help, table 'test' looks like below: ID Group1 Value1 Group2 Value2 Comment 01 aaa 1 bbb 2 02 aaa 2 bbb 1 03 aaa 3 bbb 4 04 cc 2 d 6 05 cc 1 d 4 06 cc 5 e 7 The idea is add value to Comment, compare Value1 or Value2 by corresponding group, the row with the lowest value will have 'Y' in comment, else get a 'N'. For example, row ID=01 has value1=1 which is lowest in Group1=aaa, then comment='Y'; row ID=02 has value1=2 not the lowest in aaa, but it has Value2=1, the lowest in Group2=bbb, so comment='Y'. The updated table 'want' would be like below: ID Group1 Value1 Group2 Value2 Comment 01 aaa 1 bbb 2 Y 02 aaa 2 bbb 1 Y 03 aaa 3 bbb 4 N 04 cc 2 d 6 N 05 cc 1 d 4 Y 06 cc 5 e 7 Y How can I do it in SAS? Thanks, Leon
... View more