In my project I need to iteratively sample some portfolio data and run this through a model. To reduce computation time in the model I have created a key that makes use of the symmetry and clumps all similar entities in the portfolio together. When trying without iterating this is easily done by some group by statements. This is roughly what i'm doing:
proc surveyselect data=tot
method=srs n=10000 out=port_in noprint;
run;
Proc Sql;
Create table port as
select distinct KEY_ID, ID_1, ID_2, sum(w) as w_s
from port_in
group by KEY_ID
;quit;
where KEY_ID is a unique number for all combinations of ID_1 and ID_2.
I know that I can call on these inside my proc iml but what i want to know if this is the most efficient way of achieving what i want or if using only iml functions is better. So what i want to achieve is this:
1 Sample a portfolio from a larger one
2 Reduce its size by summing and only getting distinct values
3 Insert 2 into a model
4 Repeat