06-30-2016 10:33 PM
im new to programming and only recently been trained in programming in SAS ( a couple of months )
i have a code that i have been working on and im struck on the last part and would like to post for some ideas to test.
i want to create a variable called 'extended date' to add 36 months to today() date. this would be rolling. i also needed to created dates in past, that is the reason for the year=2010
do year=2010 to year(today());
do month=1 to month(today());
format SAS_date date9.;
my results so far is below to today()
ideal results would look something like this, taking today's date and then creating the next month for the next 36 months into the future
today() is always rolling to next month and extended date is taking today() and adding a month for 36 month into the future
07-01-2016 12:09 AM
You have the code for incrementing 36 months from your previous question.
Is it the next 6 months your looking for? To the end of the year? I can see your output but don't understand the logic.
07-01-2016 02:16 AM
im trying to create a date from today () to 36 month forward into the future.
those dates are from the past as i also need to get a date from a certain date in the past to today. this part i already figured out
07-01-2016 02:29 AM
07-01-2016 02:55 AM
Data want; Do I=1 to 36; Date=INTNX ('month', today(), I, 'b'); OUTPUT; end;
format date date9.; Run;
This creates a dataset with dates incrementing up to 36 months in the future.
07-01-2016 02:58 AM
thanks, this helps. Tested,it created the next 36 months.
i will combine by code to get historical dates and future dates
thank you for your help!!!!...
07-01-2016 12:44 AM
So either this is a homework question or you have two accounts?