Getting Started with Time Series Work in SAS
SAS has had time series capabilities for decades, and it shows. The PROC autoregap and PROC forecast procedures are workhorse tools that most people never learn to use properly because the documentation reads like it was written in 1989. The actual workflow is straightforward once you figure out the data structure requirements, but getting there takes some patience. The first thing nobody tells you is that your data needs to be in a very specific format before any of the procedures will work correctly. SAS time series procedures expect either a time-indexed dataset or a BY-group setup with explicit _TYPE_ and _BYVar_ variables. If you just dump a regular flat file into PROC ARIMA, you will get errors that make no sense. The simplest fix is to create a time index variable using the INTNX function, then sort by it. I spent two days debugging what I thought was a model convergence issue when the real problem was just that my observations weren't properly indexed. PROC ARIMA is where most people end up. It is the most powerful procedure in the SAS/ETS suite for this kind of work. You identify the model using autocorrelation and partial autocorrelation functions, estimate the parameters, check residuals, and then forecast. Each step is a separate block in your code, which feels archaic but actually gives you fine-grained control that other packages don't offer. The IDENTIFY statement defines your series and suggests starting orders. The ESTIMATE statement fits the model. The TEST statement validates residuals. The FORECAST statement produces predictions.
Here is a practical example. Say you have monthly sales data going back five years. You want to forecast the next twelve months. Your data step creates the time variable, the IDENTIFY statement picks up the series, and you start with a simple AR(1) model to see if it even makes sense. If the ACF decays slowly and the PACF cuts off after lag one, you are probably looking at an autoregressive process. If both tail off gradually, you may need an MA component or differencing. This is standard box-jenkins methodology, nothing fancy, but it works consistently in SAS when your data is clean. The output from PROC ARIMA includes parameter estimates with standard errors, AIC and SBC values for model comparison, and Ljung-Box test statistics for residual autocorrelation. Most people only look at the parameter estimates and ignore the rest. That is a mistake. The AIC difference between two competing models tells you more than you might think. A difference of more than ten is essentially decisive. A difference of two to four is worth considering. I learned this the hard way when I was arguing over whether an ARMA(1,1) or an ARMA(2,0) was better. The AIC said the simpler model was clearly superior, but I kept second-guessing myself until the diagnostic plots finally agreed with it. Seasonality is where things get tricky. The SAS procedures handle seasonal ARIMA models through the SEASON= option in the IDENTIFY statement and the P D Q notation in the ESTIMATE statement. You specify something like P=1 D=1 Q=1 S=12 to indicate a seasonal AR term, a seasonal difference, a seasonal MA term, and a seasonal period of twelve. But here is the catch that the manuals barely mention: if your data has missing values within a seasonal cycle, the estimation can become unreliable. I had a dataset where three months out of every year had gaps due to reporting delays. The seasonal parameters kept drifting. The workaround was to use the INTERPOLATE=AVE option in PROC TIMESERIES to fill the gaps with interpolated values before running the ARIMA analysis. That stabilized everything.
Another thing worth knowing is that PROC FORECAST is faster but less flexible. It does exponential smoothing and regression-based forecasting without the full identification and testing framework. If you just need quick predictions and do not care about rigorous diagnostics, it is adequate. For anything requiring model selection or residual analysis, stick with PROC ARIMA. The extra coding effort pays off in a year when someone asks you to defend your methodology to a stakeholder who has a statistics background. There are limitations you should be aware of. PROC ARIMA assumes stationarity after differencing. If your series has structural breaks, level shifts, or regime changes, the model will fit poorly and the forecasts will be unreliable. SAS does not have built-in detection for structural breaks the way some newer packages do. You have to flag those periods yourself and either remove them or model them explicitly with intervention variables. The INTPUT statement in PROC ARIMA lets you add step and pulse interventions, but you need to know where they are before you specify them. Large datasets are another issue. PROC ARIMA can struggle with series longer than about ten thousand observations. The computational overhead increases significantly, and memory usage can become a problem on standard hardware. If you are working with high-frequency data like daily transactions or hourly sensor readings, consider aggregating to a lower frequency or using PROC UCM instead, which handles large datasets more efficiently through state-space methods.
The SAS University Edition is a free way to access these procedures if you do not have a commercial license. You can run it in a browser without installing anything locally. The procedures available include PROC ARIMA, PROC FORECAST, PROC UCM, PROC TIMESERIES, and PROC DLM. Everything you need for standard time series work, though some advanced features require a full SAS/ETS license. If you are coming from R or Python, the learning curve is steeper but the payoff is real. SAS time series workflows reproduce reliably across different machines and versions, which matters in regulated environments. The code is verbose, yes, but verbosity is the price of auditability. I have seen teams switch back to SAS after trying Python because their forecasting models were non-deterministic across runs due to random initialization in neural network approaches. SAS gives you the same answer every time you run the same code. The documentation lives at sassoftware.com support and is organized by procedure. Start with the PROC ARIMA chapter in the Statistical Procedures guide. The examples there cover the standard cases. When you hit edge cases like yours, the sections on intervention analysis and irregular time series are the ones to read.
Get the Full Details
