Hi, I want to create a new variable "MonthPaid" that is dependent on two other date variables. Here is how I created the variable for one month (January 2016): data new; set old; if (pwrkcode='D' and workcode='P' and ('01jan2016'd <= dtclpaid <='31jan2016'd) and ('01jan2016'd <= dtwork <='31jan2016'd)) then MonthPaid='Jan-16'; run; How would I turn this data step into an array/macro to create the variable for 12 months (I want 'MonthPaid' to populate with 'Jan-16', 'Feb-16', 'Mar-16', ........'Dec-16')? Ideally, I'd like to factor in the year, as well, ('MonthPaid would also populate with 'Jan-17', 'Feb-17', etc.) but if that's too complicated, I'm fine having a data step for each year of interest. If there's a better approach, I'm happy to adjust my plan. AC
... View more