Fun with Looping Dates

From sasCommunity
Jump to: navigation, search

by Russell Byers

This macro is useful for performing repetitive tasks on small portions of data.

Occasionally, SAS users may need to perform repetitive tasks using only small chunks of data at a time. For example, some data systems are so large they will only allow you to pull small portions of data per request (such as one month at a time). This macro, using the intnx function, takes an input date, and then calculates the beginning and end of each week, month, or year. The dates are then nested inside of a loop to perform whatever functions are needed.




Presented at a State of Oregon SAS Users Group meeting.

Find more SOSUG presentations, as well as other tips, tricks, and tools created by or recommended by SOSUG members here.