<?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: Translating a SAS/IML list definition into a position in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Translating-a-SAS-IML-list-definition-into-a-position/m-p/777326#M5722</link>
    <description>&lt;P&gt;I feel like we might have had this conversation already?&lt;/P&gt;
&lt;P&gt;Yes, I think your confusion is because you are trying to directly delete from a sublist. You can't use ListDeleteItem for that. The easiest way to delete an item from a sublist is to use ListGetSubItem with the 'd' flag:&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' ] ] ];
call struct(L) ;

item = ListGetSubItem(L, {'L1' 'L1_1' 'L1_2'}, 'd' );  /* get value; delete from the list */
free item;  /* optional: completely delete the item */
call struct(L) ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Oct 2021 15:13:27 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-10-29T15:13:27Z</dc:date>
    <item>
      <title>Translating a SAS/IML list definition into a position</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Translating-a-SAS-IML-list-definition-into-a-position/m-p/777312#M5721</link>
      <description>&lt;DIV id="bodyDisplay_692c69e35b093a" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&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 class="language-sas"&gt;&lt;CODE&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;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Oct 2021 14:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Translating-a-SAS-IML-list-definition-into-a-position/m-p/777312#M5721</guid>
      <dc:creator>rbettinger</dc:creator>
      <dc:date>2021-10-29T14:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Translating a SAS/IML list definition into a position</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Translating-a-SAS-IML-list-definition-into-a-position/m-p/777326#M5722</link>
      <description>&lt;P&gt;I feel like we might have had this conversation already?&lt;/P&gt;
&lt;P&gt;Yes, I think your confusion is because you are trying to directly delete from a sublist. You can't use ListDeleteItem for that. The easiest way to delete an item from a sublist is to use ListGetSubItem with the 'd' flag:&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' ] ] ];
call struct(L) ;

item = ListGetSubItem(L, {'L1' 'L1_1' 'L1_2'}, 'd' );  /* get value; delete from the list */
free item;  /* optional: completely delete the item */
call struct(L) ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Oct 2021 15:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Translating-a-SAS-IML-list-definition-into-a-position/m-p/777326#M5722</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-29T15:13:27Z</dc:date>
    </item>
  </channel>
</rss>

