i have a date1 variable in this the observations was 05/01/07 and now i want to create another variable date2 and the observations shd be 05/02/07 up to end of that year as i have tried to add days to the first observation but the days diff from one month to anoher.
Here is the output:
date1 date2 date3 date4 ....... date12
05/01/07 05/02/07 05/03/07 05/04/07 .......................... 05/12/07
Message was edited by: Main
A SAS DATA step to increment your source variable by 1 while assigning a new DATE2 variable. A DO loop within the DATA step will provide logic to both assign the new variable and issue an OUTPUT with each loop iteration.
The SAS support http://support.sas.com/ website has SAS-hosted documentation and supplemental technical topic papers for reference. I used the SEARCH facility at the site and found several references - some pasted below.
For consideration, using INTNX may be useful if incrementing a DATETIME variable by the date-portion, however having a DATE variable and incrementing sequentially (adding 1 increments to the next date) really does not require using INTNX.