Hello, I'm a 2 month old SAS user and just started practicing COUNTER, RETAIN, FIRST. ,Last. and DO/END. I can understand simple examples (of course) but am getting stuck when there is missing data and multiple variables involved. For example: This data is sorted BY ID DATE TYPE already and the columns in red are what I'm trying to add in. I think Num_A should be counter+1 when the variable is the first non=missing value for A and then start over for each date. And eventually if the ID changed as well. The same for num_B and C. ID DATE TYPE A B C NUM_A NUM_B NUM_C 1 1/1/2010 B . 10 . 0 1 0 1 1/1/2010 A 3 . . 1 0 0 1 1/1/2010 A 7 . . 2 0 0 1 1/1/2010 C . . 11 0 0 1 1 3/17/2010 B . 5 . 0 1 0 1 3/17/2010 A 4 . . 1 0 0 1 3/17/2010 C . . 3 0 0 1 1 5/1/2010 B . 7 . 0 1 0 1 5/1/2010 A 3 . . 1 0 0 1 5/1/2010 C . . 4 0 0 1
... View more