Sorry guys, for not being clear. The process below will only give the total #of changes per id. I am trying to obtain a matrix containing ID and 12 variables which are binary (1/0) - 1 month, 2 months,...., 12 months. So, "2 months = 1" would mean that it took 2 months for the status to change. So, for ID 'xx' , if you look at the SAS table 'have' created from the below procedure, there are following changes -
1. in Jul11- as the STATUS was . (0) between Jul11, so "1 month" = 1
2. in Aug11 - from 1 in Jul11 to . (0) in Aug11, so "1 month" = 1
3. in Jan12 - from . (0) in Aug11 to 1 in Jan12, so "5 month" = 1 as the status changed after 5 months
In total as the STATUS changed three times, so INDEX = 3.
Likelwise I am thinking of an array but I do not know a way of creating such a matrix in SAS.
KR
SK
... View more