Hi,
How to grow a sublist of the existing List in proc iml?
for eg.
proc iml;
Variable = ListCreate();
Residual = ListCreate();
Call ListAddItem(Variable,{1 2 34});
call ListAddItem(Variable,{12 4 2 2});
Call ListAddItem(Residual,{1 2 34});
call ListAddItem(Residual,{12 4 2 2});
All = ListCreate({"Variable","Residual"});
call ListSetItem(All,"Variable",Variable);
call ListSetItem(All,"Residual",Residual);
package load ListUtil; /* load ListPrint module */
run ListPrint(All);
In the above program, I have a named sublist Variable inside the List All. There is LISTGETSUBITEM function to get the subitem but there is no support to add an item to the sub list or to grow it dynamically. This is useful in cases where all the elements of a sublist are not available right in the beginning and want to maintain a structure like above.