I am trying to run multiple iterations(5400) of various combinations of predictors in Proc UCM. The SAS code with all combination of variables has been sequentially generated using an external programming code like csharp etc.

I think this can be done in SAS but thats a topic for next time.

I want to compile all the parameter estimates of all iterations into one table and all the "Smoothed estimate of sum of all components except the irregular component" into another and write some conditions on it.

Currently i am writing all the output to csv for no good.I just know i can use ODS option and specify "ParameterEstimates" and "SmoothedAllExceptIrreg" but to do it for whole 5400 iterations is something i cant figure out.

My sample code for 4 iterations is as below (1347 1348 1349 1350 are the iterations sequentially geneared based on combinations):

/*Level with variance,Season without variance,Slope without variance*/

```
ods csv file = "D:\SAS\Iteration_Hair_Care_Volume_1347.csv";
proc ucm data = project.Compiled printall;irregular ;level ;forecast lead = 8 alpha = 0.05 outfor = project.Compiled_Output_Hair;model
HC =
Gr_CPI
gdp;season length=4
var = 0 noest;slope
var = 0 noest;
where count > 36;run;quit;ods csv.close;
/*Level with variance,Season without variance,Slope with Variance*/ods csv file = "D:\SAS\Iteration_Hair_Care_Volume_1348.csv";
proc ucm data = project.Compiled printall;irregular ;level ;forecast lead = 8 alpha = 0.05 outfor = project.Compiled_Output_Hair;model
HC =
Gr_CPI
Earning_Avg_Lag;season length=4
var = 0 noest;slope ;
where count > 36;run;quit;ods csv.close;
/*Level with variance,Season with variance,Slope without Variance*/ods csv file = "D:\SAS\Iteration_Hair_Care_Volume_1349.csv";
proc ucm data = project.Compiled printall;irregular ;level ;forecast lead = 8 alpha = 0.05 outfor = project.Compiled_Output_Hair;model
HC =
Gr_CPI
pdi
season length=4 ;slope
var = 0 noest;
where count > 36;run;quit;ods csv.close;
/*Level with variance,Season with variance,Slope with Variance*/ods csv file = "D:\SAS\Iteration_Hair_Care_Volume_1350.csv";
proc ucm data = project.Compiled printall;irregular ;level ;forecast lead = 8 alpha = 0.05 outfor = project.Compiled_Output_Hair;model
HC =
Gr_CPI
IIP;season length=4 ;slope ;
where count > 36;run;quit;ods csv.close;
```

I can append iteration numbers to outfor=xyz dataset but i dont know what good comes out of it. How do i automate this. Kindly help me with this.