Resources

Combining Monthly and Quarterly Data

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: expex01.sas
 Description: Example program from SAS/ETS User's Guide,
              The EXPAND Procedure
       Title: Combining Monthly and Quarterly Data
     Product: SAS/ETS Software
        Keys: time series conversion and interpolation
        PROC: EXPAND
       Notes:

--------------------------------------------------------------*/
 
data qtrly;
   set sashelp.citiqtr;
   where date >= '1jan1990'd &
         date <  '1jan1992'd ;
   keep date gdp gd;
run;
 
title "Quarterly Data";
proc print data=qtrly;
run;
 
data monthly;
   set sashelp.citimon;
   where date >= '1jan1990'd &
         date <  '1jan1992'd ;
   keep date ip lhur;
run;
 
title "Monthly Data";
proc print data=monthly;
run;
 
proc expand data=qtrly out=temp from=qtr to=month;
   convert gdp gd / observed=average;
   id date;
run;
 
data combined;
   merge monthly temp;
   by date;
run;
 
title "Combined Data Set";
proc print data=combined;
run;