10-22-2015 10:53 AM
Using the APPEND statement, output data can be created within Proc IML. Using Proc Append within a macro do loop, output can be concatenated from multiple, separate Proc IML calls within that macro.
My question concerns concatenating or updating output data within a do loop from a single Proc IML call. The APPEND statement only retains the most recent value from the loops. I would like to track the successive values within each iteration of that loop. So, if the loop iterates 100 times, then there would be 100 values appended to a single output data set.
Is this possible in Proc IML?
10-22-2015 11:08 AM
Your comment helped jog me into a solution. By placing the "create" statement above the initiation of the do loop, placing the "append" statement withing the loop and the "close" statement after the end of the loop, I got the desired results.
10-22-2015 11:44 AM
I'll add that you can use this same technique to write data sets that are larger than can fit into RAM, or to write the results of multivariate computations without needing to remember the results while inside the loop.
For using this technique to write large data, see "Writing data in chunks"
To see it in an application of simulating logistic response variable, see "Simulate many samples from a logistic regression model"
Search for "Append" on this pages and notice that the append is inside a DO loop, but the CREATE and CLOSE are not.