Working with Time Series Data
Storing Time Series in a SAS Data Set
This section discusses aspects of storing time series in SAS data sets. The topics discussed are the standard form of a time series data set, storing several series with different time ranges in the same data set, omitted observations, cross-sectional dimensions and BY groups, and interleaved time series.
Any number of time series can be stored in a SAS data set. Normally, each time series is stored in a separate variable. For example, the following statements augment the USCPI data set read in the previous example with values for the producer price index (PPI):
data usprice;
input date : monyy7. cpi ppi;
format date monyy7.;
label cpi = "Consumer Price Index"
ppi = "Producer Price Index";
datalines;
jun1990 129.9 114.3
jul1990 130.4 114.5
aug1990 131.6 116.5
... more lines ...
proc print data=usprice; run;
Figure 3.4: Time Series Data Set Containing Two Series
Copyright © SAS Institute Inc. All rights reserved.