<?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 Need help to understand the code in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518118#M3490</link>
    <description>&lt;P&gt;What would be the output value for group when the age is not 14? and why&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;if age = 14 and sex = 'M' then do;&lt;BR /&gt;y =1;&lt;BR /&gt;group = '2';&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;y =2;&lt;BR /&gt;group = '22';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 15:33:29 GMT</pubDate>
    <dc:creator>Guptashwe</dc:creator>
    <dc:date>2018-12-03T15:33:29Z</dc:date>
    <item>
      <title>Need help to understand the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518118#M3490</link>
      <description>&lt;P&gt;What would be the output value for group when the age is not 14? and why&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;if age = 14 and sex = 'M' then do;&lt;BR /&gt;y =1;&lt;BR /&gt;group = '2';&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;y =2;&lt;BR /&gt;group = '22';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518118#M3490</guid>
      <dc:creator>Guptashwe</dc:creator>
      <dc:date>2018-12-03T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518120#M3491</link>
      <description>&lt;P&gt;So the logic is, if age=14 and sex=m do first set, otherwise do second set.&amp;nbsp; If age is not 14, then the first part of the if is false, and so the if statement cannot be true, therefore operation passes to the else do section.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518120#M3491</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-03T15:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518121#M3492</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/249630"&gt;@Guptashwe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;What would be the output value for group when the age is not 14? and why&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;if age = 14 and sex = 'M' then do;&lt;BR /&gt;y =1;&lt;BR /&gt;group = '2';&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;y =2;&lt;BR /&gt;group = '22';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can run the code yourself and find out what the output value for group is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why is that value assigned? Anyone who is 14 years old AND sex='M' gets group='2'. Everyone else is processed through the ELSE DO; block of code.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 15:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518121#M3492</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-03T15:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to understand the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518132#M3495</link>
      <description>&lt;P&gt;So the variable GROUP will always have the value '2'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you explain why?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 16:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-to-understand-the-code/m-p/518132#M3495</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-03T16:00:57Z</dc:date>
    </item>
  </channel>
</rss>

