<?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: If/Then in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564977#M11129</link>
    <description>&lt;P&gt;Sorry else if&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2019 17:51:18 GMT</pubDate>
    <dc:creator>swayto</dc:creator>
    <dc:date>2019-06-10T17:51:18Z</dc:date>
    <item>
      <title>If/Then</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564843#M11112</link>
      <description>&lt;P&gt;Practice Question&lt;/P&gt;&lt;P&gt;data word.new;&lt;/P&gt;&lt;P&gt;length word $7;&lt;/P&gt;&lt;P&gt;amount=4;&lt;/P&gt;&lt;P&gt;If amount=4 then word ='four';&lt;/P&gt;&lt;P&gt;else if amount=7 then word = 'seven';&lt;/P&gt;&lt;P&gt;else word='NONE!!!!';&lt;/P&gt;&lt;P&gt;amount=7;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Answer&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amount Word&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 7 FOUR&lt;/P&gt;&lt;P&gt;Can somebody please explain the rational behind the answer.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 17:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564843#M11112</guid>
      <dc:creator>swayto</dc:creator>
      <dc:date>2019-06-10T17:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564850#M11114</link>
      <description>&lt;P&gt;There is a concept of PDV in SAS, the Program Data Vector is a logical area of memory that is created during the data step processing. SAS builds a SAS dataset by reading one observation at a time into the PDV and, unless given code to do otherwise, writes the observation to a target dataset.So here in the beginning as per the data step, the amount=4; then the same values is used to fill the value of variable amount=4, then the if/then step is read and since amount=4 when its read the word variable is set to FOUR, then again the amount variable is read again and this time since the value is 7 the amount of 4 is overwritten with 7. And since after this there is no if/then the same values will remain and are output. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 10:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564850#M11114</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-06-10T10:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564886#M11116</link>
      <description>The simple answer:  SAS executes statements in the DATA step in order.&lt;BR /&gt;&lt;BR /&gt;First it sets AMOUNT to 4.&lt;BR /&gt;&lt;BR /&gt;Next it calculates WORD.  &lt;BR /&gt;&lt;BR /&gt;Next it sets AMOUNT to 7.&lt;BR /&gt;&lt;BR /&gt;Last, it outputs the result.</description>
      <pubDate>Mon, 10 Jun 2019 12:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564886#M11116</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-10T12:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564920#M11119</link>
      <description>&lt;P&gt;The code as shown has an error in the IF condition and likely would error out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134135"&gt;@swayto&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Practice Question&lt;/P&gt;
&lt;P&gt;data word.new;&lt;/P&gt;
&lt;P&gt;length word $7;&lt;/P&gt;
&lt;P&gt;amount=4;&lt;/P&gt;
&lt;P&gt;If amount=4 then word ='four';&lt;/P&gt;
&lt;P&gt;else amount=7 then word = 'seven';&lt;/P&gt;
&lt;P&gt;else word='NONE!!!!';&lt;/P&gt;
&lt;P&gt;amount=7;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;Answer&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Amount Word&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 7 FOUR&lt;/P&gt;
&lt;P&gt;Can somebody please explain the rational behind the answer.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 15:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564920#M11119</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-10T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then</title>
      <link>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564977#M11129</link>
      <description>&lt;P&gt;Sorry else if&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 17:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/If-Then/m-p/564977#M11129</guid>
      <dc:creator>swayto</dc:creator>
      <dc:date>2019-06-10T17:51:18Z</dc:date>
    </item>
  </channel>
</rss>

