I have to make a counter by two variables, Month and City. I need it to count up the days per month per city and right now it is counting up only per month so I end up with 62 days for august for the cities combined instead of 31 for each city and that is happening for each month. Is there a way to code it to start from one for every month and city? Thanks Here is my code: data ozone; set ozone; run; proc sort data = ozone; by Month; run; data ozone; set ozone; by Month; if first.Month then Day = 1; else Day+1; run; proc print data = ozone; title 'New Variable - Day';
... View more