<?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: Overwriting records based information in two columns in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Overwriting-records-based-information-in-two-columns/m-p/537628#M33107</link>
    <description>&lt;P&gt;Post test data in the form of a datastep, and show what you want out.&amp;nbsp; Pictures, attachments etc. are not useful.&amp;nbsp; As such I will present a theory:&lt;/P&gt;
&lt;P&gt;1) Reverse sort the data so that record 4 is first, then 3 then 2 then 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Retain last value using retain statement.&lt;/P&gt;
&lt;P&gt;3) Replace actual value as needed.&lt;/P&gt;
&lt;P&gt;4) Resort data back to original form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this, if you don't have identifiers which give the order, then you would need to assign an order variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 10:27:15 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-02-22T10:27:15Z</dc:date>
    <item>
      <title>Overwriting records based information in two columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Overwriting-records-based-information-in-two-columns/m-p/537623#M33106</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data which I'll need to update as I go along. It's payslip information where old data will have to be overwritten with amended records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My unique identifier per row is called payslip_id and my unique identifier to identify which payslips records need to be amended is called&amp;nbsp;&lt;/P&gt;&lt;P&gt;previous_payslip_id. previous_payslip_id will correspond to the value in payslip_id which needs to be overwritten. See below for an example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27346iA8C897D8F2D2CA35/image-size/large?v=v2&amp;amp;px=999" role="button" title="example.png" alt="example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this person has for four records. So the information on record 3 needs to overwrite the records in record 2 and then subsequently the information in record 4 needs to overwrite the information from record 3 which is now in record 2. So after this person will only be left with two entries. The first one and the last.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone think of an efficient way to do this, as the example above can occur multiple times for an individual but the logic behind it is the same.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 10:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Overwriting-records-based-information-in-two-columns/m-p/537623#M33106</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2019-02-22T10:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting records based information in two columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Overwriting-records-based-information-in-two-columns/m-p/537628#M33107</link>
      <description>&lt;P&gt;Post test data in the form of a datastep, and show what you want out.&amp;nbsp; Pictures, attachments etc. are not useful.&amp;nbsp; As such I will present a theory:&lt;/P&gt;
&lt;P&gt;1) Reverse sort the data so that record 4 is first, then 3 then 2 then 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Retain last value using retain statement.&lt;/P&gt;
&lt;P&gt;3) Replace actual value as needed.&lt;/P&gt;
&lt;P&gt;4) Resort data back to original form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this, if you don't have identifiers which give the order, then you would need to assign an order variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 10:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Overwriting-records-based-information-in-two-columns/m-p/537628#M33107</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-22T10:27:15Z</dc:date>
    </item>
  </channel>
</rss>

