<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Understanding an IML list in matrix notation in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776779#M5720</link>
    <description>&lt;P&gt;Continuing the conversation re: representing an IML list structure as a matrix, how do I determine the position of the item L3_4 in the following example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml ; package load ListUtil ;
L = [ #'L1'=[ #'L1_1' = [ #'L1_2' = 'item L1_2' ] ]
    , #'L2'=[ #'L2_1' = 'item L2_1']
    , #'L3'=[ #'L3_1 '= [ #'L3_2' = [ #'L3_3' = [ #'L3_4'= 'item L3_4' ] ] ] ]
    ] ;
call struct(L) ;
call listprint( L ) ;
quit ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If I want to delete item L$'L3'$'L3_1'$'L3_2'$'L3_3'$'L3_4', how do I use ListDeleteItem() to do this? How do I represent the position as a numeric matrix of indices or a character matrix of item names? Is my confusion due to the fact that I am trying to delete an item from a sublist? If so, how do I delete an item from a sublist?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2021 15:50:49 GMT</pubDate>
    <dc:creator>rbettinger</dc:creator>
    <dc:date>2021-10-27T15:50:49Z</dc:date>
    <item>
      <title>Understanding an IML list in matrix notation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776592#M5716</link>
      <description>&lt;P&gt;I am trying to understand how IML creates a list that can be described as a matrix.&lt;/P&gt;
&lt;P&gt;The documentation refers to item position in many List* commands and I can visualize a list as a linear array of items, addressable by scalars, e.g., L$1, L$2, L$3. But when there is more than one level to a list, e.g.,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml ; package load ListUtil ;
L = [ #L1=[#L1_1=[#L1_2='Terminal Node']]
    , #L2=[ #L2_1='Terminal Node']
    , #L3=[#L3_1=[#L3_2=[#L3_3=[#L3_4='Terminal Node']]]]
    ] ;
call struct(L) ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then I do not understand how to specify the position of an item, e.g., L$L3$L3_1$L3_2$L3_3$L3_4 .&lt;/P&gt;
&lt;P&gt;Please help me to understand the specification of an item's position in a complex list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 19:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776592#M5716</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-10-26T19:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding an IML list in matrix notation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776604#M5717</link>
      <description>&lt;P&gt;Although your example of defining a named list works, it is a shorthand for the more correct definition&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;L = [ #'L1'=[#'L1_1'=[#'L1_2'='Terminal Node']], ... ];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Names are character strings, so to retrieve the index you want, specify the list names as follows:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;M =&amp;nbsp;L$'L3'$'L3_1'$'L3_2'$'L3_3'$'L3_4';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 20:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776604#M5717</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-26T20:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding an IML list in matrix notation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776612#M5718</link>
      <description>Your reply seems to have released a mental block. I referred to the&lt;BR /&gt;LISTGETSUBITEM documentation and saw the example where&lt;BR /&gt;M2=ListGetSubItem(L, ["A",2] ) ;&lt;BR /&gt;&lt;BR /&gt;Then I applied the example to my question and show the result below:&lt;BR /&gt;&lt;BR /&gt;proc iml ; package load ListUtil ;&lt;BR /&gt;L = [ #'L1'=[#'L1_1'=[#'L1_2'='Terminal Node']]&lt;BR /&gt;    , #'L2'=[ #'L2_1'='Terminal Node']&lt;BR /&gt;    , #'L3'=[#'L3_1'=[#'L3_2'=[#'L3_3'=[#'L3_4'='Terminal Node']]]]&lt;BR /&gt;     ] ;&lt;BR /&gt;call struct(L) ;&lt;BR /&gt;L_3_1_2_3_4 = L$'L3'$'L3_1'$'L3_2'$'L3_3'$'L3_4' ;&lt;BR /&gt;call struct( L_3_1_2_3_4 ) ;&lt;BR /&gt;call struct( L$'L3'$'L3_1'$'L3_2'$'L3_3'$'L3_4' ) ;&lt;BR /&gt;TermNode = ListGetSubItem( L, [ 'L3', 'L3_1', 'L3_2', 'L3_3', 'L3_4' ]) ;&lt;BR /&gt;print TermNode ;&lt;BR /&gt;quit ;&lt;BR /&gt;&lt;BR /&gt;Now I can proceed. Thanks once again, Rick!&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Oct 2021 20:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776612#M5718</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-10-26T20:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding an IML list in matrix notation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776615#M5719</link>
      <description>&lt;P&gt;Great. Glad to hear!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll mention further that if all the elements are named items, it is simpler (and more efficient) to pass a character array (rather thana list) as the last argument to the GetListSubItem function:&lt;/P&gt;
&lt;P&gt;TermNode = ListGetSubItem( L, {'L3', 'L3_1', 'L3_2', 'L3_3', 'L3_4'}) ;&lt;/P&gt;
&lt;P&gt;or even&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TermNode = ListGetSubItem( L, {L3 L3_1 L3_2 L3_3 L3_4}) ;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 20:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776615#M5719</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-26T20:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding an IML list in matrix notation</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776779#M5720</link>
      <description>&lt;P&gt;Continuing the conversation re: representing an IML list structure as a matrix, how do I determine the position of the item L3_4 in the following example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml ; package load ListUtil ;
L = [ #'L1'=[ #'L1_1' = [ #'L1_2' = 'item L1_2' ] ]
    , #'L2'=[ #'L2_1' = 'item L2_1']
    , #'L3'=[ #'L3_1 '= [ #'L3_2' = [ #'L3_3' = [ #'L3_4'= 'item L3_4' ] ] ] ]
    ] ;
call struct(L) ;
call listprint( L ) ;
quit ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If I want to delete item L$'L3'$'L3_1'$'L3_2'$'L3_3'$'L3_4', how do I use ListDeleteItem() to do this? How do I represent the position as a numeric matrix of indices or a character matrix of item names? Is my confusion due to the fact that I am trying to delete an item from a sublist? If so, how do I delete an item from a sublist?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 15:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Understanding-an-IML-list-in-matrix-notation/m-p/776779#M5720</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-10-27T15:50:49Z</dc:date>
    </item>
  </channel>
</rss>

