<?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: DO statement not working in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132431#M36034</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see also:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function" title="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function"&gt;http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; sasComm.org maven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Mar 2013 21:43:30 GMT</pubDate>
    <dc:creator>Ron_MacroMaven</dc:creator>
    <dc:date>2013-03-11T21:43:30Z</dc:date>
    <item>
      <title>DO statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132429#M36032</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'm trying to write a code that will calculate ages of all members of a family (MEM1 to MEM7) from their dob. My data looks like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="512"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;FAMILY&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM1&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM3&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM4&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM5&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM6&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;MEM7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;001&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;2/1/1941&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;9/1/2000&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;2/1/2004&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;002&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;6/1/1989&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;003&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;8/1/1963&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;8/1/1963&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;004&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;9/1/1994&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="64"&gt;6/1/2000&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the following code, it says MEMi variable is uninitialized. Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;set b ;&lt;/P&gt;&lt;P&gt;array age {7} age1-age7;&lt;/P&gt;&lt;P&gt;array age_mem {7} age_mem1-age_mem7;&lt;/P&gt;&lt;P&gt;do i=1 to 7;&lt;/P&gt;&lt;P&gt;age(i)=floor( (intck('month', MEM(i), '01jan2013'd) -(day('01jan2013'd) &amp;lt; day(MEM(i))))/12);&lt;/P&gt;&lt;P&gt;age_mem(i)= age(i)-(floor( (intck('month', MEM(i), '01jan2013'd) -(day('01jan2013'd) &amp;lt; min(day(MEM(i)), day(intnx('month','01jan2013'd,1) -1)))/12)));&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 20:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132429#M36032</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2013-03-11T20:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: DO statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132430#M36033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you need an additional array:&lt;/P&gt;&lt;P&gt;array mem mem1-mem7;&lt;/P&gt;&lt;P&gt;and [] instead of () usually&lt;/P&gt;&lt;P&gt;so&lt;/P&gt;&lt;P&gt;age(i)=floor( (intck('month', MEM&lt;I&gt;, '01jan2013'd) -(day('01jan2013'd) &amp;lt; day(MEM(i))))/12);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;age&lt;I&gt;=floor( (intck('month', MEM&lt;I&gt;, '01jan2013'd) -(day('01jan2013'd) &amp;lt; day(MEM&lt;I&gt;)))/12);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 20:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132430#M36033</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-03-11T20:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: DO statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132431#M36034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see also:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function" title="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function"&gt;http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; sasComm.org maven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 21:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132431#M36034</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2013-03-11T21:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: DO statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132432#M36035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message is because the name of the array was AGE_MEM and not MEM.&lt;/P&gt;&lt;P&gt;Look at this thread for how to calculate age.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;A __default_attr="148612" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you probably do not want the OUTPUT statement.&amp;nbsp; Unless you also want to rotate the data into a vertical format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 00:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132432#M36035</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-12T00:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: DO statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132433#M36036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey! Thanks for the tips on the age calculation facility in SAS 9.3. I do have that version and will make use of it towards this end.&lt;/P&gt;&lt;P&gt;Thanks again, all. I also&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;fixed the code to make it run now. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-statement-not-working/m-p/132433#M36036</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2013-03-12T14:06:37Z</dc:date>
    </item>
  </channel>
</rss>

