Hi:
When you are dealing with data, such as you describe, SAS will not automatically "detect" the change you want to track. However, you can write a program to detect a change in ABB status from one week to the next. Some folks have suggested PROC TRANSPOSE, other people have suggested using ARRAYs. Either method would work.
In either case, you need to consider how to turn data that looks something like this (what I would call long and skinny data):
[pre]
BP NAME ABB DSET
10000001 Jack J. CAMPAIGN 160710
10000001 Jack J. CAMPAIGN 230710
10000001 Jack J. CAMPAIGN 300710
10000001 Jack J. CAMPAIGN 100810
10000001 Jack J. CAMPAIGN 130810
10000006 Karen K NORMAL 230710
10000006 Karen K NORMAL 300710
10000006 Karen K NORMAL 100810
10000006 Karen K NORMAL 130810
10000007 Albert A CAMPAIGN 160710
10000007 Albert A CAMPAIGN 230710
10000007 Albert A NORMAL 300710
10000008 Lisa L CAMPAIGN 230710
10000008 Lisa L CAMPAIGN 300710
10000008 Lisa L CAMPAIGN 100810
10000008 Lisa L CAMPAIGN 130810
10000009 Kal L CAMPAIGN 230710
10000009 Kal L NORMAL 300710
10000009 Kal L NORMAL 100810
10000009 Kal L CAMPAIGN 130810
10000009 Kal L SPECIAL 150910
[/pre]
Into data that is "wide" -- so that you have 1 row per BP/NAME, like this:
[pre]
bp name dt1 dt2 dt3 dt4 dt5 abb1 abb2 abb3 abb4 abb5
10000001 Jack J. 16JUL2010 23JUL2010 30JUL2010 10AUG2010 13AUG2010 CAMPAIGN CAMPAIGN CAMPAIGN CAMPAIGN CAMPAIGN
10000006 Karen K 23JUL2010 30JUL2010 10AUG2010 13AUG2010 . NORMAL NORMAL NORMAL NORMAL
10000007 Albert A 16JUL2010 23JUL2010 30JUL2010 . . CAMPAIGN CAMPAIGN NORMAL
10000008 Lisa L 23JUL2010 30JUL2010 10AUG2010 13AUG2010 . CAMPAIGN CAMPAIGN CAMPAIGN CAMPAIGN
10000009 Kal L 23JUL2010 30JUL2010 10AUG2010 13AUG2010 15SEP2010 CAMPAIGN NORMAL NORMAL CAMPAIGN SPECIAL
[/pre]
You only have 52 weeks in any single year period, so that's not a huge array. For any single BP or NAME, you could find out how many of the ABB values were the same and how many were different just by comparing each ABB to the next ABB in the array.
Based on using an ARRAY, you could come up with a summary like this for each BP/NAME:
[pre]
bp name numsame numdiff numweeks
10000001 Jack J. 4 0 5
10000006 Karen K 3 0 4
10000007 Albert A 1 1 3
10000008 Lisa L 3 0 4
10000009 Kal L 1 3 5
[/pre]
Where NUMSAME is the number of comparisons that were the same and NUMDIFF is the number of comparisons that were different. For example, Albert A, if you eyeball the data -- has 3 total weeks of data -- between the first value and the second value, there is no change, so that's where the 1 came from for NUMSAME; but, between the second value and the third value, the values were different, so that's how NUMDIFF would get set to 1. If you needed to capture the FROM and TO values where the change occurred, you could do that too. Something like this (shown for Albert):
[pre]
bp name abbdiff datediff
10000007 Albert A from: CAMPAIGN to: NORMAL 30JUL2010
[/pre]
Using ARRAYs to turn skinny data into WIDE data will require that you understand how ARRAYs work, how the DATA step works and how BY group processing works (because you will need to build your ARRAY using FIRST.BY-variable and LAST.BY-variable processing.
A good paper that introduces ARRAY processing is this one:
http://support.sas.com/rnd/papers/sgf07/arrays1780.pdf
A good paper on basic DATA step concepts is here:
http://www2.sas.com/proceedings/sugi29/252-29.pdf
cynthia