Hi guys,
I'm trying to set an interval of time of 1 month from a starting date (named "admission" in the original dataset).
Starting dates are for example: 01JAN2017, 01FEB2017, 01MAR2017 etc.
I'm using the following code:
data data;
set mydataset;
discharge = INTNX('month', admission, +1);
format discharge date9.;
run;
The following output is generated:
01JAN2017 01FEB2017
01FEB2017 01MAR2017
01MAR2017 01APR2017
..................... ......................
Is there a way to prevent the start-ending day is the same? In other words I would like to prevent that for example 01FEB2017 appears two times: one as ending day of an interval and the other as the starting day of the subsequent interval. This because I'm counting observation and if the same day is reported two times it is difficult to assign observations to the previous or subsequent month.
Is there a way to prevent this? It is ok if the month ends with 28-29 (FEB) or 30-31 and the starting day is always the first day of the month.
Thank you in advance