Hi, This is a Base SAS solution. In SAS/IML there might be similar or better, more effective solutions. There you use IML functions instead of macro of course. /*This is your simulation code put into a macro*/ %macro simulationMacro(scenario, simpar1, simpar2, simpar3); data step using &simpar1 and &simpar2.; proc step using &simpar3.; etc; /*You might need a step at the end, that collects results into a single dataset*/ proc append base=all_results data=current_result force; run; %mend; /*I generate an example parameter table with 4 rows. You have 108 rows.*/ /*Of course you should access your real Excel workbook, with libname ex excel ...; or proc import */ data data_in_Excel; datalines; input scenario simpar1 simpar2 simpar3; 1 3 4 5 2 4 5 6 3 6 7 8 108 1 1 1 ; run; /*Creating a macro, that reads the parameter table, then calls simulation code 108 times*/ %macro do_cycle(); proc sql noprint; select scenario, simpar1, simpar2, simpar3 into :scenario_list separated by '*', :simpars_list1 separated by '*', :simpar_list2 separated by '*', :simpar_list3 separated by '*' quit; %do i=1 %to 108; /* %sysfunc(countw(&scenario_list.,*) ) - instead of hardcoding 108... */ %let scenario=%scan(&scenario_list.,&i.,*);/*extracting parameters from parameter lists*/ %let simpar1=%scan(&simpar_list1.,&i.,*); %let simpar2=%scan(&simpar_list2.,&i.,*); %let simpar3=%scan(&simpar_list3.,&i.,*); %simulationMacro(&scenario., &simpar1., &simpar2., &simpar3.);/*calling the simulation*/ %end; %mend; /*Calling the macro*/ %do_cycle(); post processing, etc.
... View more