<?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: I want to know if the above problem is right in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896389#M354189</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;pointed correctly, you'd have to use procedure (as in the description of you homework &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;).&lt;BR /&gt;&lt;BR /&gt;Although, the data step is incorrect anyway:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You don't retain the value of OldestMother and OlderstFather to next rows when processing. So when if statements are evaluated, &amp;nbsp;you're just comparing the values within the same row, you're not considering previous values of dmage, dfage (I'd suggest to play around with this a bit and see the numbers yourself).&lt;/LI&gt;&lt;LI&gt;There is no data structure provided in your question, so I'm only guessing the row consists of a couple, where in row you have age of mother and father. When you use if dfage &amp;lt; 99, you will exclude rows, and loose information on dmage&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 08:47:55 GMT</pubDate>
    <dc:creator>Lukkul</dc:creator>
    <dc:date>2023-09-29T08:47:55Z</dc:date>
    <item>
      <title>I want to know if the above problem is right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896362#M354171</link>
      <description>&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;What is the oldest mother (dmage) and what is the oldest father (dfage) in the Main SAS data set.&amp;nbsp; For father’s age, exclude age 99. (3 pts)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Unfinished Code&lt;/P&gt;&lt;P&gt;*HW 3 - Problem 2;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;finished code&lt;/P&gt;&lt;P&gt;data lab.oldest_ages;&lt;BR /&gt;set lab.main;&lt;BR /&gt;OldestMother = .;&lt;BR /&gt;OldestFather = .;&lt;BR /&gt;if dmage &amp;gt; OldestMother then&lt;BR /&gt;OldestMother = dmage;&lt;BR /&gt;if dfage &amp;lt; 99 ;&lt;BR /&gt;if OldestFather = . or dfage &amp;gt; OldestFather then&lt;BR /&gt;OldestFather = dfage;&lt;BR /&gt;where dmage ^= . and dfage ^= .;&lt;BR /&gt;run;&lt;BR /&gt;proc print data= lab.oldest_ages (firstobs = 1 obs=10);&lt;BR /&gt;var dmage&amp;nbsp;dfage;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 03:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896362#M354171</guid>
      <dc:creator>Markanti</dc:creator>
      <dc:date>2023-09-29T03:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: I want to know if the above problem is right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896365#M354174</link>
      <description>&lt;P&gt;Since the "unfinished code" begins with the word PROC, it looks like you should use a SAS procedure, and not a DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at PROC MEANS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to run it twice (once for the fathers and once for the mothers), because excluding fathers age 99 might exclude an observation needed for processing the mothers.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 03:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896365#M354174</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-09-29T03:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: I want to know if the above problem is right</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896389#M354189</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;pointed correctly, you'd have to use procedure (as in the description of you homework &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;).&lt;BR /&gt;&lt;BR /&gt;Although, the data step is incorrect anyway:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You don't retain the value of OldestMother and OlderstFather to next rows when processing. So when if statements are evaluated, &amp;nbsp;you're just comparing the values within the same row, you're not considering previous values of dmage, dfage (I'd suggest to play around with this a bit and see the numbers yourself).&lt;/LI&gt;&lt;LI&gt;There is no data structure provided in your question, so I'm only guessing the row consists of a couple, where in row you have age of mother and father. When you use if dfage &amp;lt; 99, you will exclude rows, and loose information on dmage&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 08:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-know-if-the-above-problem-is-right/m-p/896389#M354189</guid>
      <dc:creator>Lukkul</dc:creator>
      <dc:date>2023-09-29T08:47:55Z</dc:date>
    </item>
  </channel>
</rss>

