<?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: how to get number of months ? in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6579#M659</link>
    <description>Richard:&lt;BR /&gt;
  To code the equivalent of the PRE tags, do not use the LT and GT symbols, instead use square brackets.&lt;BR /&gt;
'['  pre  ']' &lt;BR /&gt;
'['  /pre  ']'  without the spaces and quotes&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
some code&lt;BR /&gt;
some more code&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Mon, 28 Jan 2008 16:38:22 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2008-01-28T16:38:22Z</dc:date>
    <item>
      <title>how to get number of months ?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6576#M656</link>
      <description>I have data in field date1 = 200702 and date= 200608&lt;BR /&gt;
&lt;BR /&gt;
I need the result of date1-date2 = 6 months. How can i get it ?</description>
      <pubDate>Mon, 28 Jan 2008 13:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6576#M656</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T13:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get number of months ?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6577#M657</link>
      <description>the function you're looking for is &lt;A href="http://support.sas.com/91doc/getDoc/lrdict.hlp/a000212868.htm"&gt;intck&lt;/A&gt;. when given two date values, it returns the number of specified boundaries between the two values.&lt;BR /&gt;
&lt;BR /&gt;
if you've got actual date values, you'll probably want to use those. i assumed you didn't so there is some conversion from 200702 to '01FEB2007'd.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
  date1 = 200608;&lt;BR /&gt;
  date2 = 200702;&lt;BR /&gt;
  d1 = input(put(date1, 6.), yymmn6.);&lt;BR /&gt;
  d2 = input(put(date2,6.), yymmn6.);&lt;BR /&gt;
  format d1 d2 date9.;&lt;BR /&gt;
  months = intck('month',d1, d2);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: RichardK&lt;BR /&gt;
added link to sas documentation&lt;BR /&gt;
trying cynthia's tip</description>
      <pubDate>Mon, 28 Jan 2008 14:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6577#M657</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T14:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to get number of months ?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6578#M658</link>
      <description>sorry about the format of the data step above...these forums don't seem to like html tags&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
  date1 = 200608;&lt;BR /&gt;
  date2 = 200702;&lt;BR /&gt;
  d1 = input(put(date1, 6.), yymmn6.);&lt;BR /&gt;
  d2 = input(put(date2,6.), yymmn6.);&lt;BR /&gt;
  format d1 d2 date9.;&lt;BR /&gt;
  months = intck('month',d1, d2);&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 28 Jan 2008 16:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6578#M658</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-28T16:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to get number of months ?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6579#M659</link>
      <description>Richard:&lt;BR /&gt;
  To code the equivalent of the PRE tags, do not use the LT and GT symbols, instead use square brackets.&lt;BR /&gt;
'['  pre  ']' &lt;BR /&gt;
'['  /pre  ']'  without the spaces and quotes&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
some code&lt;BR /&gt;
some more code&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 28 Jan 2008 16:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/how-to-get-number-of-months/m-p/6579#M659</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-01-28T16:38:22Z</dc:date>
    </item>
  </channel>
</rss>

