<?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 obtaining minor to major using date diffs? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124400#M34186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am providing a sample data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)I need the investor who attained the minor &lt;STRONG&gt;to major on 14/01/2012 ( i&lt;/STRONG&gt; .e greater than equal to 18 years)&lt;/P&gt;&lt;P&gt;2)I should pick up the entire address from another database (have2) with the INVNAME?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;input name$&amp;nbsp; dob DATE10.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;SHARMA&amp;nbsp; 10/10/2010&lt;/P&gt;&lt;P&gt;TRISHA A 30/11/1992&lt;/P&gt;&lt;P&gt;TRISHA&amp;nbsp; 30/11/1999&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; 30/05/2000&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; 26/03/1991&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;input INVNAME $8.&amp;nbsp; STATE$&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACNO$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;SHARMA&amp;nbsp; UTTAR PRADESH 813120*****&lt;/P&gt;&lt;P&gt;TRISHA&amp;nbsp; GUJARAT 819173*****&lt;/P&gt;&lt;P&gt;TRISHA A GUJARAT 826162*****&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; GUJARAT 826293*****&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; GUJARAT 826313*****&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2013 15:45:17 GMT</pubDate>
    <dc:creator>allurai0412</dc:creator>
    <dc:date>2013-01-14T15:45:17Z</dc:date>
    <item>
      <title>obtaining minor to major using date diffs?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124400#M34186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am providing a sample data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)I need the investor who attained the minor &lt;STRONG&gt;to major on 14/01/2012 ( i&lt;/STRONG&gt; .e greater than equal to 18 years)&lt;/P&gt;&lt;P&gt;2)I should pick up the entire address from another database (have2) with the INVNAME?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;input name$&amp;nbsp; dob DATE10.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;SHARMA&amp;nbsp; 10/10/2010&lt;/P&gt;&lt;P&gt;TRISHA A 30/11/1992&lt;/P&gt;&lt;P&gt;TRISHA&amp;nbsp; 30/11/1999&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; 30/05/2000&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; 26/03/1991&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;input INVNAME $8.&amp;nbsp; STATE$&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACNO$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;SHARMA&amp;nbsp; UTTAR PRADESH 813120*****&lt;/P&gt;&lt;P&gt;TRISHA&amp;nbsp; GUJARAT 819173*****&lt;/P&gt;&lt;P&gt;TRISHA A GUJARAT 826162*****&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; GUJARAT 826293*****&lt;/P&gt;&lt;P&gt;SANGHVI&amp;nbsp; GUJARAT 826313*****&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 15:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124400#M34186</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-01-14T15:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining minor to major using date diffs?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124401#M34187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Formula for Age :&lt;/P&gt;&lt;PRE class="jive-pre"&gt;age = floor ((intck('month',birth,somedate) - (day(somedate) &amp;lt; day(birth))) / 12); &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;select invname, state, acno, dob, floor((intck('month', dob, '14Jan2012'd)-(day('14jan2012'd)&amp;lt;day(dob)))/12) as age&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;join have2&lt;/P&gt;&lt;P&gt;on name=invname&lt;/P&gt;&lt;P&gt;where age&amp;gt;=18;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attained minor to major on and greater than equal on are two different classifications. Do you want everyone who turned 18 on that date or anyone who was older than 18 as of that date?&lt;/P&gt;&lt;P&gt;You can play around with the where clause to get what you want, and you may also need to modify the join (left/right/full) depending on your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;1)I need the investor who attained the minor &lt;STRONG&gt;to major on 14/01/2012 ( i&lt;/STRONG&gt; .e greater than equal to 18 years)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 15:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124401#M34187</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-01-14T15:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining minor to major using date diffs?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124402#M34188</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;what's the logic behind the sub code day(somedate) &amp;lt; day(birth)))?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please explain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALLU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 14:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/obtaining-minor-to-major-using-date-diffs/m-p/124402#M34188</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-01-15T14:23:22Z</dc:date>
    </item>
  </channel>
</rss>

