<?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: Data cleaning on date and number in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833024#M35743</link>
    <description>&lt;P&gt;Hi, Yes you are right. What we been told the latest update of the&amp;nbsp;&lt;SPAN&gt;service_req has the correct information, we just presume&amp;nbsp;thats the case. As we are just dealing with the data, it comes from the book. So I guess its fine to apply to all people. Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 00:58:03 GMT</pubDate>
    <dc:creator>miss2223</dc:creator>
    <dc:date>2022-09-13T00:58:03Z</dc:date>
    <item>
      <title>Data cleaning on date and number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833020#M35740</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got two questions, below is my data code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;data input;&lt;BR /&gt;input Account Name$ birthday: ddmmyy10. startdate: ddmmyy10. enddate: ddmmyy10. service_req;&lt;/P&gt;&lt;P&gt;format birthday: ddmmyy10. startdate: ddmmyy10. enddate: ddmmyy10.;&lt;BR /&gt;datalines;&lt;BR /&gt;1232 Ryan 01/01/1990 07/04/2017 01/03/2022 9356&lt;BR /&gt;1232 Ryan 01/01/1990 02/03/2022 27/08/2022 9667&lt;BR /&gt;1440 Chris 13/12/1987 11/03/2019 19/03/2022 5112&lt;BR /&gt;1440 Chris 11/12/1987 01/04/2022 30/12/9999 7891&lt;BR /&gt;1211 May 05/04/1998 13/09/2017 11/08/2022 1209&lt;BR /&gt;1265 Sandy 10/12/1988 12/08/2022 01/10/2022 1287&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be great if someone can help me out, as I'm new to SAS. Please break down to one code per question instead of combine the code to answer both question, if its possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Typo on Chris's birthday, account 1440 for Chris, one entry of the birthday is&amp;nbsp;13/12/1987, the other one is&amp;nbsp;11/12/1987. We believe the latest service request provides the correct date of birth&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;birthday&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1232&lt;/TD&gt;&lt;TD&gt;Ryan&lt;/TD&gt;&lt;TD&gt;1/01/1990&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1440&lt;/TD&gt;&lt;TD&gt;Chris&lt;/TD&gt;&lt;TD&gt;11/12/1987&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1211&lt;/TD&gt;&lt;TD&gt;May&lt;/TD&gt;&lt;TD&gt;5/04/1998&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1265&lt;/TD&gt;&lt;TD&gt;Sandy&lt;/TD&gt;&lt;TD&gt;10/12/1988&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I want the latest service request if there is dup under the same ID and same name. In this scenario I want 9667 for Ryan's service request. And&amp;nbsp;7891 for Chris.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;service_req&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1232&lt;/TD&gt;&lt;TD&gt;Ryan&lt;/TD&gt;&lt;TD&gt;9667&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1440&lt;/TD&gt;&lt;TD&gt;Chris&lt;/TD&gt;&lt;TD&gt;7891&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1211&lt;/TD&gt;&lt;TD&gt;May&lt;/TD&gt;&lt;TD&gt;1209&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1265&lt;/TD&gt;&lt;TD&gt;Sandy&lt;/TD&gt;&lt;TD&gt;1287&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 23:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833020#M35740</guid>
      <dc:creator>miss2223</dc:creator>
      <dc:date>2022-09-12T23:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data cleaning on date and number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833023#M35742</link>
      <description>&lt;P&gt;If you have multiple birth dates for the same person how do you know it is always the one with the latest service_req that is correct? If you code such a general rule it will apply to all people.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 00:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833023#M35742</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-09-13T00:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data cleaning on date and number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833024#M35743</link>
      <description>&lt;P&gt;Hi, Yes you are right. What we been told the latest update of the&amp;nbsp;&lt;SPAN&gt;service_req has the correct information, we just presume&amp;nbsp;thats the case. As we are just dealing with the data, it comes from the book. So I guess its fine to apply to all people. Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 00:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833024#M35743</guid>
      <dc:creator>miss2223</dc:creator>
      <dc:date>2022-09-13T00:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data cleaning on date and number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833044#M35752</link>
      <description>&lt;P&gt;Here's one way of getting the correct birth date. Would be worth trying on your actual data to see how it goes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as
  select A.*
        ,C.birthday as birthday_correct
  from input as A
  left join
  (select Account
         ,max(enddate) as enddate_Max format = ddmmyy10.
   from input
   group by Account
  ) as B
  on A.Account = B.Account
  left join input as C
  on A.account = C.Account
  and B.enddate_Max = C.enddate
  ;
quit; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Sep 2022 04:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-cleaning-on-date-and-number/m-p/833044#M35752</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-09-13T04:51:53Z</dc:date>
    </item>
  </channel>
</rss>

