<?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: Calculating age in weeks and months using 2 SAS dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754588#M237989</link>
    <description>I removed the brackets, and added the 'C' function for the continuous method, and I still get the same error messages.&lt;BR /&gt;Here is the revised code:&lt;BR /&gt;if DOB NE . and EXAMDATE ne . then do;&lt;BR /&gt;AGE_EXAM_MO= intck(‘MONTH’,DOB,EXAMDATE,'C');&lt;BR /&gt;FORMAT CHILDDOB AGDEXAMDATE MMDDYY10.;&lt;BR /&gt;&lt;BR /&gt;And this is the error message:&lt;BR /&gt;8643 DATA EXAMAGE;&lt;BR /&gt;8644 SET MERGEDOB;&lt;BR /&gt;8645 /*CREATE AGE AT EXAM*/&lt;BR /&gt;8646 if DOB NE . and EXAMDATE ne . then do;&lt;BR /&gt;8647 AGE_EXAM_MO= intck(‘MONTH’,DOB,EXAMDATE,'C');&lt;BR /&gt;-&lt;BR /&gt;386&lt;BR /&gt;200&lt;BR /&gt;76&lt;BR /&gt;ERROR 386-185: Expecting an arithmetic expression.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;</description>
    <pubDate>Fri, 16 Jul 2021 13:51:15 GMT</pubDate>
    <dc:creator>TLAM</dc:creator>
    <dc:date>2021-07-16T13:51:15Z</dc:date>
    <item>
      <title>Calculating age in weeks and months using 2 SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754452#M237922</link>
      <description>&lt;P&gt;I am trying to calculate age of newborns between date of birth and an exam date in weeks or months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using this statement:&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;if&lt;/SPAN&gt;&amp;nbsp;DOB NE &lt;SPAN class="s2"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt; and EXAMDATE ne &lt;SPAN class="s2"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;then&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;do&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;AGE_AT_EXAM= intck(‘month’,DOB,EXAMDATE());&lt;/P&gt;&lt;P class="p1"&gt;RUN;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;But I receive the following error messages. What am I doing wrong?&amp;nbsp;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;ERROR 386-185: Expecting an arithmetic expression.&lt;/P&gt;&lt;P class="p1"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P class="p1"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 21:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754452#M237922</guid>
      <dc:creator>TLAM</dc:creator>
      <dc:date>2021-07-15T21:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age in weeks and months using 2 SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754456#M237924</link>
      <description>EXAMDATE() - why the brackets? That makes SAS think it's a function. Remove the brackets and it will resolve as a variable.&lt;BR /&gt;&lt;BR /&gt;You also want to use the C option in that function I believe, check the documentation for the fourth parameter which you have not specified.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jul 2021 21:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754456#M237924</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T21:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age in weeks and months using 2 SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754588#M237989</link>
      <description>I removed the brackets, and added the 'C' function for the continuous method, and I still get the same error messages.&lt;BR /&gt;Here is the revised code:&lt;BR /&gt;if DOB NE . and EXAMDATE ne . then do;&lt;BR /&gt;AGE_EXAM_MO= intck(‘MONTH’,DOB,EXAMDATE,'C');&lt;BR /&gt;FORMAT CHILDDOB AGDEXAMDATE MMDDYY10.;&lt;BR /&gt;&lt;BR /&gt;And this is the error message:&lt;BR /&gt;8643 DATA EXAMAGE;&lt;BR /&gt;8644 SET MERGEDOB;&lt;BR /&gt;8645 /*CREATE AGE AT EXAM*/&lt;BR /&gt;8646 if DOB NE . and EXAMDATE ne . then do;&lt;BR /&gt;8647 AGE_EXAM_MO= intck(‘MONTH’,DOB,EXAMDATE,'C');&lt;BR /&gt;-&lt;BR /&gt;386&lt;BR /&gt;200&lt;BR /&gt;76&lt;BR /&gt;ERROR 386-185: Expecting an arithmetic expression.&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jul 2021 13:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754588#M237989</guid>
      <dc:creator>TLAM</dc:creator>
      <dc:date>2021-07-16T13:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age in weeks and months using 2 SAS dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754591#M237992</link>
      <description>Nevermind, I realize the error. I tried using double quote rather than single quote, and that worked.&lt;BR /&gt;Thank you so much!</description>
      <pubDate>Fri, 16 Jul 2021 13:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age-in-weeks-and-months-using-2-SAS-dates/m-p/754591#M237992</guid>
      <dc:creator>TLAM</dc:creator>
      <dc:date>2021-07-16T13:55:30Z</dc:date>
    </item>
  </channel>
</rss>

