<?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: Retaining in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Retaining/m-p/210474#M52072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data after (drop=vno);&lt;/P&gt;&lt;P&gt;set before (rename=(vehicle_nos=vno));&lt;/P&gt;&lt;P&gt;by policy_no year;&lt;/P&gt;&lt;P&gt;retain vehicle_nos;&lt;/P&gt;&lt;P&gt;if first.year&lt;/P&gt;&lt;P&gt;then vehicle_nos = vno;&lt;/P&gt;&lt;P&gt;else vehicle_nos = vehicle_nos + vno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2015 11:34:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2015-08-31T11:34:56Z</dc:date>
    <item>
      <title>Retaining</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Retaining/m-p/210473#M52071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to adjust my dataset as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "before" dataset below is a sample from my existing dataset; the "after" is where I want it to be. Basically, the vehicle_years field is populated in the first entry of each year and then if there is a change over the year the change is given; all other entries are 0. I want (for each policy and each year) to cumulate the initial figure over each following transaction in the same year.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data before; &lt;BR /&gt;infile datalines dlm=',';&lt;BR /&gt;input policy_no&amp;nbsp; year&amp;nbsp; vehicle_nos 5. ;&lt;BR /&gt;datalines ;&lt;BR /&gt;123,2010,1233&lt;BR /&gt;123,2010,1&lt;BR /&gt;123,2010,0&lt;BR /&gt;123,2011,1234&lt;BR /&gt;123,2011,0&lt;BR /&gt;123,2011,1&lt;BR /&gt;123,2011,0&lt;BR /&gt;123,2011,4&lt;BR /&gt;123,2012,1234&lt;BR /&gt;123,2012,0&lt;BR /&gt;123,2012,1&lt;BR /&gt;124,2010,12345&lt;BR /&gt;124,2010,0&lt;BR /&gt;124,2010,0&lt;BR /&gt;124,2011,12445&lt;BR /&gt;124,2011,0&lt;BR /&gt;124,2011,1&lt;BR /&gt;124,2012,13444&lt;BR /&gt;124,2012,0&lt;BR /&gt;124,2012,0&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data after; &lt;BR /&gt;infile datalines dlm=',';&lt;BR /&gt;input policy_no&amp;nbsp; year&amp;nbsp; vehicle_nos 5. ;&lt;BR /&gt;datalines ;&lt;BR /&gt;123,2010,1233&lt;BR /&gt;123,2010,1234&lt;BR /&gt;123,2010,1234&lt;BR /&gt;123,2011,1234&lt;BR /&gt;123,2011,1234&lt;BR /&gt;123,2011,1235&lt;BR /&gt;123,2011,1235&lt;BR /&gt;123,2011,1239&lt;BR /&gt;123,2012,1234&lt;BR /&gt;123,2012,1234&lt;BR /&gt;123,2012,1235&lt;BR /&gt;124,2010,12345&lt;BR /&gt;124,2010,12345&lt;BR /&gt;124,2010,12345&lt;BR /&gt;124,2011,12345&lt;BR /&gt;124,2011,12345&lt;BR /&gt;124,2011,12346&lt;BR /&gt;124,2012,13444&lt;BR /&gt;124,2012,13444&lt;BR /&gt;124,2012,13444&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 11:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Retaining/m-p/210473#M52071</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2015-08-31T11:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Retaining/m-p/210474#M52072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data after (drop=vno);&lt;/P&gt;&lt;P&gt;set before (rename=(vehicle_nos=vno));&lt;/P&gt;&lt;P&gt;by policy_no year;&lt;/P&gt;&lt;P&gt;retain vehicle_nos;&lt;/P&gt;&lt;P&gt;if first.year&lt;/P&gt;&lt;P&gt;then vehicle_nos = vno;&lt;/P&gt;&lt;P&gt;else vehicle_nos = vehicle_nos + vno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 11:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Retaining/m-p/210474#M52072</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-31T11:34:56Z</dc:date>
    </item>
  </channel>
</rss>

