In reply to ankush.

Ankush,

Hello! Sorry for the delay on replying. I am providing two alternatives because you don’t describe your situation in detail.

This video can be useful for you:
Using SAS Viya to Automatically Model and Forecast Time Series Data https://video.sas.com/detail/video/5361764615001/using-sas-viya-to-automatically-model-and-forecast-time-series-data

Here are the alternatives:

#1
In TSMODEL you can specify all these Predefined Scalar Values
_FORMAT_
time format, which is either implied by the INTERVAL= option or specified in the FORMAT= option in the ID statement
_HORIZON_
the time ID value that is one period beyond _TEND_
_INTERVAL_
time interval, which is specified in the INTERVAL= option in the ID statement
_LEAD_
forecast horizon or lead, which is specified in the LEAD= option in the PROC TSMODEL statement
_LENGTH_
length of the time series that is associated with the current BY group
_SERIES_
series index or BY-group counter. When PROC TSMODEL runs in a parallel processing environment, the index value is relative to the machine that processes the series or BY group. Therefore, values of _SERIES_ might not be unique and could also vary for multiple executions of the procedure.
_SEASONALITY_
length of the seasonal cycle, which is specified in the SEASONALITY= option in the PROC TSMODEL statement or implied by the INTERVAL= option in the ID statement
_TEND_
the last time ID value over all the BY groups. _TEND_ is independent of the value of the TRIMID= option in the ID statement, but the value of _TEND_ is the same as the ending value of the output time ID variable span if you specify TRIMID=NONE.
_TSTART_
the first time ID value over all the BY groups. _TSTART_ is independent of the value of the TRIMID= option in the ID statement, but the value of _TSTART_ is the same as the starting value of the output time ID variable span if you specify TRIMID=NONE.

#2

You could use the atsm package calling it thru proc tsmodel

proc tsmodel data = mylib.pricedata
outobj = (outFor = mylib.outFor(replace = YES)
outEst = mylib.outEst(replace = YES)
outStat = mylib.outStat(replace = YES)
modInfo = mylib.modInfo(replace = YES)
outSel = mylib.outSel(replace = YES));
by regionname productline productname;
id date interval=month;
var sale /acc = sum;
var price/acc = avg;

/*IMPORTANT: use ATSM package */
require atsm;

You will need to declare ATSM Objects, and then use something similar to this:

submit;
/*declare ATSM objects */

declare object dataFrame(TSDF);
declare object diagnose(DIAGNOSE);
declare object diagSpec(DIAGSPEC);
declare object forecast(FORENG);
declare object outFor(OUTFOR);
declare object outEst(OUTEST);
declare object outStat(OUTSTAT);
declare object modInfo(OUTMODELINFO);
declare object outSel(OUTSELECT);

/*setup dependent and independent variables for the data frame*/
rc= dataFrame.initialize();
rc= dataFrame.addY(sale);
rc= dataFrame.addX(price, 'required', 'no', 'extend', 'stochastic');

/*setup time series diagnose specifications */
rc= diagSpec.open();
rc= diagSpec.setArimax('identify', 'both');
rc= diagSpec.setEsm('method', 'best');
rc= diagSpec.setTransform('transform', 'auto');
rc= diagSpec.close();
/*diagnose time series to generate candidate model list*/
rc= diagnose.initialize(dataFrame);
rc= diagnose.setSpec(diagSpec);rc= diagnose.run();
/*run model selection and forecast */
rc= forecast.initialize(diagnose);
rc = forecast.setOption('criterion','rmse');
rc = forecast.setOption('lead', 12, 'holdoutpct', 0.1);
rc= forecast.run();
/*collect forecast results */
rc= outFor.collect(forecast);
rc= outEst.collect(forecast);
rc= outStat.collect(forecast);
rc= modInfo.Collect(forecast);
rc= outSel.Collect(forecast);
endsubmit;
run;

Finally, the SAS documentation is very useful, here is a link for Visual Forecasting
https://support.sas.com/software/products/visual-forecasting/index.html#s1=2

Best,
Patricia