I had never thought to use SAS/MACRO within SAS/IML, but the CALL SYMPUT suggestion works just fine! Thank you very much, Rick.
Here is my code. The first example does not use CALL SYMPUT, and the second one does, giving me the flexibility that I need.
proc iml ; package load listutil ;
print 'this code does not use CALL SYMPUT' ;
L = [ #'Input' = ] ;
call struct(L) ; call listprint(L) ;
L$([ 'Input' ]) = L$([ 'Input' ]) || [ #'Var1' = [ #a=, #b=, #c=]] ;
call struct(L) ; call listprint(L) ;
L$([ 'Input', 'Var1' ]) = L$([ 'Input', 'Var1' ]) || [ #'MF1'=[ #mf1=, #mf2=, #mf3=, #mf4=]] ;
call struct(L) ; call listprint(L$'Input'$'Var1') ;
L_I_V = L$'Input'$'Var1'$'MF1' ; call struct(L_I_V ) ;
print 'this code uses CALL SYMPUT' ;
call symput( 'VAR', "Var1" ) ;
call symput( 'MF' , 'MF1' ) ;
L= [ #'Input'= ] ; call struct(L) ;
L$([ 'Input' ]) = L$([ 'Input' ]) || [ #"&VAR" = [ #a=, #b=, #c=]] ;
call struct(L) ;
L_I = L$'Input'$"&VAR" ; call struct(L_I ) ;
L$([ 'Input', "&VAR" ]) = L$([ 'Input', "&VAR" ]) || [ #"&MF"=[ #mf1=, #mf2=, #mf3=, #mf4=]] ;
call struct(L) ;
L_I_V = L$'Input'$"&VAR"$"&MF" ; call struct(L_I_V ) ;
quit ;
I noticed that the call struct( L ) command does not produce all of the sublist and items of the list L. How can I tell the struct() module to print the entire structure of the list? Are the parameters stored somewhere and can I use a list function to change them?