<?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 do statement for age calculation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129505#M35302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;This is a new twist to a question I’d asked in this forum some time back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Can someone please see why this macro is not working? I’m calculating ages of different family members over different years (this also helps me to account for newcoming members and those that expire). &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I’m trying to calculate age of each person in the family at the end of the year. I don’t see the ages increasing each year. Any inputs?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;(A=year, b=weeks)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%macro calc(a,b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;data set&amp;amp;a&amp;amp;b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;set set&amp;amp;a&amp;amp;b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array person {9} person1-person9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array age {9} age1-age9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array age_person {9} age_person1-age_person9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;do i=1 to 9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;age&lt;I&gt;=floor( (intck('month', PERSON&lt;I&gt;, &lt;SPAN style="background: yellow;"&gt;'31dec20&amp;amp;a'd&lt;/SPAN&gt;) -(day(&lt;SPAN style="background: yellow;"&gt;'31dec20&amp;amp;a'd&lt;/SPAN&gt;) &amp;lt; day(PERSON&lt;I&gt;)))/12);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%calc (12,52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%calc (11,52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Thanks,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 May 2013 20:11:19 GMT</pubDate>
    <dc:creator>spg</dc:creator>
    <dc:date>2013-05-03T20:11:19Z</dc:date>
    <item>
      <title>do statement for age calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129505#M35302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;This is a new twist to a question I’d asked in this forum some time back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Can someone please see why this macro is not working? I’m calculating ages of different family members over different years (this also helps me to account for newcoming members and those that expire). &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I’m trying to calculate age of each person in the family at the end of the year. I don’t see the ages increasing each year. Any inputs?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;(A=year, b=weeks)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%macro calc(a,b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;data set&amp;amp;a&amp;amp;b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;set set&amp;amp;a&amp;amp;b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array person {9} person1-person9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array age {9} age1-age9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;array age_person {9} age_person1-age_person9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;do i=1 to 9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;age&lt;I&gt;=floor( (intck('month', PERSON&lt;I&gt;, &lt;SPAN style="background: yellow;"&gt;'31dec20&amp;amp;a'd&lt;/SPAN&gt;) -(day(&lt;SPAN style="background: yellow;"&gt;'31dec20&amp;amp;a'd&lt;/SPAN&gt;) &amp;lt; day(PERSON&lt;I&gt;)))/12);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%calc (12,52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%calc (11,52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Thanks,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 20:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129505#M35302</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2013-05-03T20:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: do statement for age calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129506#M35303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try changing your single quotes to double quotes and ending your macro var with a period.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 20:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129506#M35303</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-03T20:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: do statement for age calculation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129507#M35304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked like a charm Thank you Reeza!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 20:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-statement-for-age-calculation/m-p/129507#M35304</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2013-05-03T20:28:24Z</dc:date>
    </item>
  </channel>
</rss>

