Aj
2006-06-19 08:23:46 UTC
Hi All
I think using "RETAIN" and the last . or first . function this can be
done in a data step. But then
how can we use Proc SQL to assign rank to product with a BATCH ID (
Product being sorted in ascending order) .
THE TABLE IS AS FOLLOWS:
Batch Id Product
1 Q
1 W
1 E
2 A
2 C
3 U
3 T
TO RESULT SHOULD LOOK LIKE
Batch Id Product RANK
1 E 1
1 Q 2
1 W 3
2 A 1
2 C 2
3 T 1
3 U 2
I think using "RETAIN" and the last . or first . function this can be
done in a data step. But then
how can we use Proc SQL to assign rank to product with a BATCH ID (
Product being sorted in ascending order) .
THE TABLE IS AS FOLLOWS:
Batch Id Product
1 Q
1 W
1 E
2 A
2 C
3 U
3 T
TO RESULT SHOULD LOOK LIKE
Batch Id Product RANK
1 E 1
1 Q 2
1 W 3
2 A 1
2 C 2
3 T 1
3 U 2