Hum, the item 71 is the "sunday did" and a week shall start at sunday?
Adding an echo line "ECHO -a testing: $date(dd.mm.yy ddd) - did for $day is %did" I get:

testing: 04.08.08 Mon - did for Monday is 72
did -a dname 72 4
did -a dname 73 5
did -a dname 74 6
did -a dname 75 7
did -a dname 76 8
did -a dname 77 9
did -a dname 71 3
= the week "Sun, August 3th to Sat, August 9th"

setting now the system clock to august 1st I get:

testing: 01.08.08 Fri - did for Friday is 76
did -a dname 76 1
did -a dname 77 2
did -a dname 71 27
did -a dname 72 28
did -a dname 73 29
did -a dname 74 30
did -a dname 75 31
= the week "Sun, July 27th to Sat, August 2nd"