The ESM procedure is simple to use and does not require in-depth knowledge of forecasting methods. It can provide results in output data sets or in other output formats by using the Output Delivery System (ODS). The following examples are more fully illustrated in Forecasting of Transactional Data.

Given an input data set that contains numerous time series variables recorded at a specific frequency, the ESM procedure can forecast the series as follows:

proc esm data=<input-data-set> out=<output-data-set>; id <time-ID-variable> interval=<frequency>; forecast <time-series-variables>; run;

For example, suppose that the input data set `SALES`

contains sales data recorded monthly, the variable that represents time is `DATE`

, and the forecasts are to be recorded in the output data set `NEXTYEAR`

. The ESM procedure could be used as follows:

proc esm data=sales out=nextyear; id date interval=month; forecast _numeric_; run;

The preceding statements generate forecasts for every numeric variable in the input data set `SALES`

for the next twelve months and store these forecasts in the output data set `NEXTYEAR`

. Other output data sets can be specified to store the parameter estimates, forecasts, statistics of fit, and summary data.

By default, PROC ESM generates no printed output. If you want to print the forecasts by using the Output Delivery System (ODS), then you need to add the PRINT=FORECASTS option to the PROC ESM statement, as shown in the following example:

proc esm data=sales out=nextyear print=forecasts; id date interval=month; forecast _numeric_; run;

Other PRINT= options can be specified to print the parameter estimates, statistics of fit, and summary data.

The ESM procedure can forecast both time series data, whose observations are equally spaced by a specific time interval (for example, monthly, weekly), or transactional data, whose observations are not spaced with respect to any particular time interval.

Given an input data set that contains transactional variables not recorded at any specific frequency, the ESM procedure accumulates the data to a specific time interval and forecasts the accumulated series as follows:

proc esm data=<input-data-set> out=<output-data-set>; id <time-ID-variable> interval=<frequency> accumulate=<accumulation>; forecast <time-series-variables> / model=<esm>; run;

For example, suppose that the input data set `WEBSITES`

contains three variables (`BOATS`

, `CARS`

, `PLANES`

) that are Internet data recorded on no particular time interval, and the variable that represents time is TIME, which records
the time of the Web hit. The forecasts for the total daily values are to be recorded in the output data set `NEXTWEEK`

. The ESM procedure could be used as follows:

proc esm data=websites out=nextweek lead=7; id time interval=dtday accumulate=total; forecast boats cars planes; run;

The preceding statements accumulate the data into a daily time series, generate forecasts for the `BOATS`

, `CARS`

, and `PLANES`

variables in the input data set (`WEBSITES`

) for the next seven days, and store the forecasts in the output data set (`NEXTWEEK`

). Because the MODEL= option is not specified in the FORECAST statement, a simple exponential smoothing model is fit to each
series.