<?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: Number of months between testdate and birthdate? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233047#M42530</link>
    <description>&lt;P&gt;The point is to get your variables to be dates. &amp;nbsp;This is a numeric variable which reflects the number of days since a certain date. &amp;nbsp;Once you have that, then just use the intck function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  test_date=20070325; dob=19800106;
run;

data want;
  set have;
  real_date_test_date=input(put(test_date,$8.),yymmdd8.);
  real_date_dob_date=input(put(dob,$8.),yymmdd8.);
  diff_in_months=intck('month',real_date_dob_date,real_date_test_date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Nov 2015 12:01:36 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-11-04T12:01:36Z</dc:date>
    <item>
      <title>Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233030#M42519</link>
      <description>&lt;P&gt;I have testdates and birthdates in format 20070315 - 20021021. I would like a column with age at testing in months, but hit a wall when trying to convert these dates into SAS-dates..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;P&gt;sas_testdate=testdate;&lt;/P&gt;&lt;P&gt;format sas_testdate yymmdd10.;&lt;/P&gt;&lt;P&gt;sas_birthdate=birthdate;&lt;/P&gt;&lt;P&gt;format sas_birthdate yymmdd10.;&lt;/P&gt;&lt;P&gt;ageattest=(sas_testdate-sas_birthdate)/365/30;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it seems this code is far off &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And if there exist a way to convert into months without dividing on days, it would be great!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233030#M42519</guid>
      <dc:creator>Alopex</dc:creator>
      <dc:date>2015-11-04T10:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233036#M42521</link>
      <description>&lt;P&gt;You will want to review the SAS documentation on the INTCK function:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;months_between=intck('month',sas_birthdate,sas_testdate);&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233036#M42521</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T10:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233037#M42522</link>
      <description>&lt;P&gt;Thank you, that was what I was looking for (I tried the SAS support pages, but didn't find this one).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it is still something wrong with my code which leads to the&amp;nbsp;sas-dates not being processed?!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233037#M42522</guid>
      <dc:creator>Alopex</dc:creator>
      <dc:date>2015-11-04T10:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233040#M42523</link>
      <description>&lt;P&gt;Can you post an example of your data (in the form of a datastep) - match it exatly to your data, but just a couple of test lines. &amp;nbsp;I suspect that in your data you may have datetime variables, or character dates or something like that (do a proc contents on the data, that would help show your data). &amp;nbsp;The intck requires both values to be date values, so you would need to datepart() datetime variables for instance, but I can't tell without seeing the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, and maybe post the code you are using to process that line of code.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233040#M42523</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T11:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233041#M42524</link>
      <description>&lt;P&gt;Hi mate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all check out this&amp;nbsp;&lt;A href="https://v8doc.sas.com/sashtml/lrcon/zenid-63.htm" target="_self"&gt;SAS Date, Time, and Datetime Values&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;There are some tricks to do this in&amp;nbsp;&lt;A href="http://support.sas.com/kb/24/574.html" target="_self"&gt;Calculate number of years, months, and days between two dates&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or try&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1pmmr2dtec32an1vbsqmm3abil5.htm" target="_self"&gt;YRDIF Function&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can test this program using intck function to get what you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 length date_1 $18 date_2 $8;
 infile datalines delimiter=','; 
 input date_1 $ date_2 $;

 datalines;
10FEB2010:00:00:00,02/07/08
10FEB2010:00:00:00,03/10/08
10FEB2010:00:00:00,04/07/08
24MAY2010:00:00:00,05/09/08
24MAY2010:00:00:00,06/11/08
24MAY2010:00:00:00,07/11/08
;

data want (drop=date_1 date_2 dt);
 set have;
 dt=input(date_1,datetime.);
 date1=datepart(dt);
 date2=input(date_2,mmddyy10.);

 month_from=intck('month',intnx('month',date1,0,'b'),intnx('month',date2,0,'b'));
 format date1 date2 mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233041#M42524</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-11-04T11:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233043#M42526</link>
      <description>&lt;P&gt;For the conversion from YYYYMMDD format to SAS date values you will need the INPUT function. Please note that SAS date values are measured in days (with 1st Jan 1960 being day 0). Your FORMAT statements are useful if the date values are to be displayed (later), but they don't affect the values stored in your variables. Hence, together with the difference calculation as suggested by RW9, your code may essentially look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
sas_testdate  = input(testdate,  yymmdd8.);
sas_birthdate = input(birthdate, yymmdd8.);
ageattest=intck('month', sas_birthdate, sas_testdate);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes that TESTDATE and BIRTHDATE are character variables containing values such as '20070315'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233043#M42526</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-11-04T11:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233044#M42527</link>
      <description>&lt;P&gt;You lost me at datastep ;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran proc contents, and both testdate and birthdate is numeric. Birthdate was provided with the dataset, testdate was found from this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Testdat = substr(Tilfelle, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; )*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Tilfelle is first column, testdate second.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;20070325038&amp;nbsp;20070325&lt;BR /&gt;20090521032&amp;nbsp;20090521&lt;BR /&gt;20070331032&amp;nbsp;20070331&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This is the closest I get, I at least get a result &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; But neither sas-date exist, only . and ******, and so there is no testalder (age at test)&amp;nbsp;either. But I'll change that code into your suggestion when I get the sas-dates going!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Testdate_sas=Testdate;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; testdate_sas &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmdd10.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;fodtdate_sas=fodt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; fodtdate_sas &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmdd10.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;testalder=((testdate_sas-fodtdate_sas)/&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;365&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;30&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233044#M42527</guid>
      <dc:creator>Alopex</dc:creator>
      <dc:date>2015-11-04T11:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233045#M42528</link>
      <description>&lt;P&gt;No, both numeric..&amp;nbsp; But in form 20070315.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233045#M42528</guid>
      <dc:creator>Alopex</dc:creator>
      <dc:date>2015-11-04T11:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233046#M42529</link>
      <description>&lt;P&gt;Hi Alopex, try using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;month_from=intck('month',intnx('month',&lt;SPAN&gt;testdate_sas&lt;/SPAN&gt;,0,'b'),intnx('month',&lt;SPAN&gt;fodtdate_sas&lt;/SPAN&gt;,0,'b'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233046#M42529</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-11-04T11:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233047#M42530</link>
      <description>&lt;P&gt;The point is to get your variables to be dates. &amp;nbsp;This is a numeric variable which reflects the number of days since a certain date. &amp;nbsp;Once you have that, then just use the intck function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  test_date=20070325; dob=19800106;
run;

data want;
  set have;
  real_date_test_date=input(put(test_date,$8.),yymmdd8.);
  real_date_dob_date=input(put(dob,$8.),yymmdd8.);
  diff_in_months=intck('month',real_date_dob_date,real_date_test_date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2015 12:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233047#M42530</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T12:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233052#M42531</link>
      <description>&lt;P&gt;I support RW9's suggestion, except that the format used in the second argument of the PUT function should be 8. instead of $8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore, please note that your code &lt;FONT face="courier new,courier"&gt;substr(Tilfelle, 1, 9) &lt;/FONT&gt;results in a 9- not 8-character string. Without the "&lt;FONT face="courier new,courier"&gt;*1&lt;/FONT&gt;" you'd directly&amp;nbsp;obtain&amp;nbsp;a character value for TESTDAT (which I would prefer). Dividing by 365 is definitely not necessary. Dividing a number of days by &lt;STRONG&gt;30&lt;/STRONG&gt; comes close to the corresponding number of months. Unlike the INTCK function this approach would allow for non-integer results (which are only approximations, though, since not all months have exactly 30 days).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 12:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233052#M42531</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-11-04T12:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233057#M42533</link>
      <description>&lt;P&gt;Thank you, I think that will help! Ok, I'll change the substr. I just played around with it until the correct numbers showed up in the output data, but when you explain it, I see how it works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit to say that since the column "tilfelle" from which I substr is numeric with a lot of ekstra spaces I think, so I need to use the original 1, 9 substr to get 20071221. No - used 2, 8 &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I tried RW9's method, but then got the log saying that I already defined a numeric variable or something like that, and I tried to remove it but that didn't work either. Will start over!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 12:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233057#M42533</guid>
      <dc:creator>Alopex</dc:creator>
      <dc:date>2015-11-04T12:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Number of months between testdate and birthdate?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233064#M42535</link>
      <description>&lt;P&gt;Yes, I was on my way out to lunch, so didn't test it. &amp;nbsp;Just change the format:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  test_date&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20070325&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; dob&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;19800106&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  real_date_test_date&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;test_date&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;8&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;yymmdd8&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  real_date_dob_date&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;dob&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;8&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;yymmdd8&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  diff_in_months&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;intck&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'month'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;real_date_dob_date&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;real_date_test_date&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Nov 2015 13:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-months-between-testdate-and-birthdate/m-p/233064#M42535</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-04T13:20:31Z</dc:date>
    </item>
  </channel>
</rss>

