<?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: Coverting variable months to years in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187641#M265769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I round it to display 2 years instead of&amp;nbsp; 2.1666666667 years&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Sep 2014 10:18:38 GMT</pubDate>
    <dc:creator>anonymous_user</dc:creator>
    <dc:date>2014-09-05T10:18:38Z</dc:date>
    <item>
      <title>Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187639#M265767</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 have a variable 'Remaining months' but I want this in a year format within proc sql but unsure on how to do this, any ideas please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remaining months 60&lt;/P&gt;&lt;P&gt;I want to display 5 years&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 09:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187639#M265767</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2014-09-05T09:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187640#M265768</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;Simply divide by 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remaining_months=60; output;&lt;/P&gt;&lt;P&gt;run;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REMAINING_MONTHS,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strip(put(REMAINING_MONTHS / 12,best.))||" years" as YEARS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 10:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187640#M265768</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-05T10:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187641#M265769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I round it to display 2 years instead of&amp;nbsp; 2.1666666667 years&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 10:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187641#M265769</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2014-09-05T10:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187642#M265770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the round function?&amp;nbsp; Alternatively the floor (probably the best one for your scenario) or ceil functions depending on scenario. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add, any SAS function can be used in a proc sql as long as you are not using pass-through (i.e. sending the sql to a database) as the DB wouldn't know about the SAS functions).&amp;nbsp; In general though there are several of the functions which are present in both SAS and native SQL, round being one of them, though slightly different syntax.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.w3schools.com/sql/sql_func_round.asp"&gt;http://www.w3schools.com/sql/sql_func_round.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.w3schools.com/sql/sql_functions.asp" title="http://www.w3schools.com/sql/sql_functions.asp"&gt;SQL Functions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 10:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187642#M265770</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-05T10:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187643#M265771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using a 5.2 format for years instead of best.&amp;nbsp;&amp;nbsp; - The best in this case is not your best. The best is showing as much as possible could make sense.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 11:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187643#M265771</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-05T11:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting variable months to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187644#M265772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA HAVE;&lt;BR /&gt; REMAINING_MONTHS=62;&lt;BR /&gt; OUTPUT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt; CREATE TABLE WANT AS&lt;BR /&gt;&amp;nbsp; SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REMAINING_MONTHS,CATS((REMAINING_MONTHS / 12), "YEARS") AS YEARS FROM HAVE;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;PROC PRINT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image" src="https://communities.sas.com/legacyfs/online/7313_Capture.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 17:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Coverting-variable-months-to-years/m-p/187644#M265772</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2014-09-05T17:56:32Z</dc:date>
    </item>
  </channel>
</rss>

