<?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: Lookup date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198559#M49628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you the September that's in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming SAS Dates, since you haven't specified, something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*claimDate=input(claim_date, yearmon7.); *if claim_date is a character variable can be converted using the input function;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if month(claimDate)&amp;lt;=9 then RenewalDate=mdy(9,1, year(claimDate));&lt;/P&gt;&lt;P&gt;else RenewalDate=mdy(9,1, year(claimDate)+1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Format renewalDate monyy7.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Mar 2015 16:10:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-03-11T16:10:47Z</dc:date>
    <item>
      <title>Lookup date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198556#M49625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hi everyone, hoping someone could assist me with a SAS statement to produce an output I'm after.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have two separate datasets as below:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Policy ClaimDate&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp; Jan 2012&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp; Aug 2012&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp; Jul 2014&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Policy RenewalDate&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Sep 2012&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Sep 2013&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Sep 2014&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;For this policy, I'm trying to group the ClaimDate into the RenewalDate. For example, if the claim is pre Sep 2012, I would like to group it into Sep 2012. If the claim is between Oct 2012 and Sep 2013, I would like to group it into Sep 2013.. and so forth.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;The final output would be something like this:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Policy ClaimDate RenewalDate&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Jan 2012&amp;nbsp;&amp;nbsp;&amp;nbsp; Sep 2012&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Aug 2012&amp;nbsp;&amp;nbsp; Sep 2012&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;ABC&amp;nbsp;&amp;nbsp; Jul 2014&amp;nbsp;&amp;nbsp;&amp;nbsp; Sep 2014&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks in advance!&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;-zorro3338&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 01:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198556#M49625</guid>
      <dc:creator>zorro3338</dc:creator>
      <dc:date>2015-03-11T01:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198557#M49626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your rules needs to more specific given your example, what happens when both Aug2012 and Jan2012 is prior to Sep2012 in both rows? what happens to Sep 2013 renewaldate?&amp;nbsp; How do you determine which goes to which? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 13:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198557#M49626</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-03-11T13:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198558#M49627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; merge A B ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 15:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198558#M49627</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-03-11T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198559#M49628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you the September that's in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming SAS Dates, since you haven't specified, something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*claimDate=input(claim_date, yearmon7.); *if claim_date is a character variable can be converted using the input function;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if month(claimDate)&amp;lt;=9 then RenewalDate=mdy(9,1, year(claimDate));&lt;/P&gt;&lt;P&gt;else RenewalDate=mdy(9,1, year(claimDate)+1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Format renewalDate monyy7.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 16:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lookup-date/m-p/198559#M49628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-11T16:10:47Z</dc:date>
    </item>
  </channel>
</rss>

