04-01-2012 01:32 AM
Hi, does anyone know how I can set a specified start date and an end date in a time series, but not inperolate like in using proc timeseries or proc expand.. So if I have a series that starts in Mar'2005, but my start date for all series I set it to Jan'2000, then all the series start at Jan'2000 and will have blanks for each month from Jan'2000 to Mar'2005.. I can do this in Proc Timeseries, but it also interpolates (in case if there are missing holes in between) which I don't want. Thanks
04-01-2012 02:19 AM
I don't understand what you mean totally.
What outpu do you like ?
If you only want a list of monthes.
do i=1 to 62;
format date monyy.;
04-01-2012 08:41 AM
Ok, if each of my series (Store by Product, over 500 of them) has data from let's say Mar'2005 to Jun'2009, with Pricing data that has some holes in between.. I would like to extend that period from Jan'2000 to Dec'2011 with simply leaving the beginning (eg. Jan'2000 to Mar'2005) with blanks/missing, and the ends (eg.Jun'2009 to Dec'2011) also having missing data.. BUT, the original holes that are in between Mar'2005 and Jun'2009 to NOT be filled in or interploated. Proc Timeseries allows to create the end (Jan'2000) and end (Dec'2011) , but the problem is that it also interpolates the holes in between Mar'2005 and Jun'2009.
I have figured a way around it, but it's a 2 step process..
Step 1. Use Proc Timeseries to create the time frame as a shell, with meaningless info.. then Step 2. just merge the original Mar'2005 to Jun'2009 using a BY group, wiht the shell in Step1.
So it's dooable, but I wondered if there's something quicker through either proc timeseries or proc expand..I think for Proc Expand I can Chose METHOD=NONE, but don't know how I can pick a start and end date..
04-01-2012 03:21 PM
Not sure what your data structure is. But you can add extra observations where needed using something like this.
Assuming that GROUP identifies the the unique analysis groupings and DATE is your date variable (also asuming DATE is a SAS date variable).
data extra ;
set have (keep=group date);
date = '01JAN2000'd ;
date = '01DEC2011'd ;
data want ;
merge extra have ;
by group date;