Thank you for the posts. I think I got the syntax to work now, with your suggestion of using lists to store matrices. For a list of transformation matrices, I have loaded them into a list (TRANS) since they are predefined. Then inside a loop, I can use another list s to store values represent a condition (i.e. if = 1, then multiply the transformation matrix, if = 0, then do other operations). Each counter value represents a value in time, i.e. i = 1 represents first month, i = 2 represents second month...etc. In the list form I can still reference previous month (i) result to carry calculation forward (i+1). I wasn't able to use $ symbol to store or call values from list, but the function ListSetItem and ListGetItem seems to be working. Thank you again. do i = 1 to 6; if s[i] = 1 then do; call ListSetItem(M, i+1, ListGetItem(M, i) * ListGetItem(TRANS, i)); end; else do; call ListSetItem(M, i+1, ListGetItem(M, 1)); end; end;

... View more