Excellent tip! As Michelle said, placing the logic in the format instead of in your DATA step code will allow for easier changes and experimentation.

For time series data (dates, datetimes), SAS offers a number of built-in formats to help you to bin your data into discrete periods like day, month, week, day-of-week, year, and so on. Check my blog about dates and datetimes for some examples of how useful this is.