Suppose we hv below data set.. I want to get max month from each obersvations in new variable. like from 1st obs Mar and in 2nd obs Apr.. data year; input jan feb mar apr jun; datalines; 100 234 340 111 231 111 212 213 314 123 run; By using below code we can calcuate maximum value data aaa; set year; top=max(jan,feb,mar,apr,jun); run; Output: Obs jan feb mar apr jun top 1 100 234 340 111 231 340 2 111 212 213 314 123 314 But i want to find variable which max value?? Please suugest solution?
... View more