<?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 Working with a large unsorted view in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/486931#M287242</link>
    <description>&lt;P&gt;Id just like some advice and pointers on ways you would take on the following task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS EG and have access to a SAS view on our warehouse.&amp;nbsp; &amp;nbsp;The table contains a record for every day that an account is open, and contains various information for that account (Date, Account_ID, Outstanding_Balance, Arrears_Amount etc etc).&amp;nbsp; &amp;nbsp;The original table that this comes from has new records added daily, so it is sorted in date order.&amp;nbsp; We have rows going back to 2012.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create monthly generation files that contain information for an account where something specific has changed from the day before.&amp;nbsp; For example, if on 21st February 2017 an Account_ID has Arrears_Amount of 0 and then on the 22nd February that Account_ID has arrears amount of 50, I would want to create a variable called Arrears_Changed and set that to "Y" and then push that row of data into the generational dataset with all other changes that occurred in February 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My challenges are that the dataset is large and not sorted by account_id and that it's a view, so efficiency is really the key here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions greatly appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Aug 2018 09:44:50 GMT</pubDate>
    <dc:creator>Jamie_H</dc:creator>
    <dc:date>2018-08-15T09:44:50Z</dc:date>
    <item>
      <title>Working with a large unsorted view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/486931#M287242</link>
      <description>&lt;P&gt;Id just like some advice and pointers on ways you would take on the following task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS EG and have access to a SAS view on our warehouse.&amp;nbsp; &amp;nbsp;The table contains a record for every day that an account is open, and contains various information for that account (Date, Account_ID, Outstanding_Balance, Arrears_Amount etc etc).&amp;nbsp; &amp;nbsp;The original table that this comes from has new records added daily, so it is sorted in date order.&amp;nbsp; We have rows going back to 2012.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create monthly generation files that contain information for an account where something specific has changed from the day before.&amp;nbsp; For example, if on 21st February 2017 an Account_ID has Arrears_Amount of 0 and then on the 22nd February that Account_ID has arrears amount of 50, I would want to create a variable called Arrears_Changed and set that to "Y" and then push that row of data into the generational dataset with all other changes that occurred in February 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My challenges are that the dataset is large and not sorted by account_id and that it's a view, so efficiency is really the key here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions greatly appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 09:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/486931#M287242</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2018-08-15T09:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Working with a large unsorted view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/486936#M287243</link>
      <description>&lt;P&gt;If your not changing the original source then:&lt;/P&gt;
&lt;P&gt;- Extract the required information into a dataset local to you (i.e. small part, only what you need)&lt;/P&gt;
&lt;P&gt;- Sort and process data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Output to file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to change the original data, then add that in as part of the capture process.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 09:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/486936#M287243</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-15T09:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Working with a large unsorted view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/487172#M287244</link>
      <description>&lt;P&gt;You saying that the original table is sorted by date (but not necessarily by account within date), is that correct?&amp;nbsp; Are you also saying that your view is not also sorted by date?&amp;nbsp; (And I take it that this is a proc sql view, not a data step view).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the view is sorted by date, than a data step reading that view and using a hash object can easily track the latest_balance by account for each incoming row/observation - i.e. one hash "dataitem" per account.&amp;nbsp;&amp;nbsp;&amp;nbsp; One can also do this with an unsorted view as well, but the hash object will take a lot more memory, depending on the number of records for each account.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-a-large-unsorted-view/m-p/487172#M287244</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-08-15T20:13:25Z</dc:date>
    </item>
  </channel>
</rss>

