<?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: Efficient way of doing a group by in SAS/IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Efficient-way-of-doing-a-group-by-in-SAS-IML/m-p/448164#M4085</link>
    <description>&lt;P&gt;Since PROC SURVEYSEELCT supports the STRATA statement and PROC SQL supports the GROUP BY statement, it seems that you could do this outside of IML. The result would be a data set that contains samples for each portfolio.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 14:16:00 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-03-23T14:16:00Z</dc:date>
    <item>
      <title>Efficient way of doing a group by in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Efficient-way-of-doing-a-group-by-in-SAS-IML/m-p/448153#M4084</link>
      <description>&lt;P&gt;In my project I need to iteratively sample some portfolio data and run this through a model. To reduce computation time in the model I have created a key that makes use of the symmetry and clumps all similar entities in the portfolio together. When trying without iterating this is easily done by some group by statements. This is roughly what i'm doing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyselect data=tot&lt;/P&gt;&lt;P&gt;method=srs n=10000 out=port_in noprint;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;/P&gt;&lt;P&gt;Create table port as&amp;nbsp;&lt;/P&gt;&lt;P&gt;select distinct KEY_ID, ID_1, ID_2, sum(w) as w_s&lt;/P&gt;&lt;P&gt;from port_in&lt;/P&gt;&lt;P&gt;group by KEY_ID&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where KEY_ID is a unique number for all combinations of ID_1 and ID_2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I can call on these inside my proc iml but what i want to know if this is the most efficient way of achieving what i want or if using only iml functions is better. So what i want to achieve is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 Sample a portfolio from a larger one&lt;/P&gt;&lt;P&gt;2 Reduce its size by summing and only getting distinct values&lt;/P&gt;&lt;P&gt;3 Insert 2 into a model&lt;/P&gt;&lt;P&gt;4 Repeat&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Efficient-way-of-doing-a-group-by-in-SAS-IML/m-p/448153#M4084</guid>
      <dc:creator>jan_t_lagen</dc:creator>
      <dc:date>2018-03-23T13:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient way of doing a group by in SAS/IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Efficient-way-of-doing-a-group-by-in-SAS-IML/m-p/448164#M4085</link>
      <description>&lt;P&gt;Since PROC SURVEYSEELCT supports the STRATA statement and PROC SQL supports the GROUP BY statement, it seems that you could do this outside of IML. The result would be a data set that contains samples for each portfolio.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 14:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Efficient-way-of-doing-a-group-by-in-SAS-IML/m-p/448164#M4085</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-23T14:16:00Z</dc:date>
    </item>
  </channel>
</rss>

