I would suggest adding observations and eliminating macro language. For example: data want; set have; do date=_start to _end; output; end; drop _start _end; run; Then you can add DATE to the list of BY variables and process the data just once.
... View more