<?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 Logic, Setting one variable = to another in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218420#M267808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added the comma because I was being sloppy &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; Thank you. &lt;/P&gt;&lt;P&gt;And yes I'll be more vigilant in code organization. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 May 2015 13:21:11 GMT</pubDate>
    <dc:creator>GalacticAbacus</dc:creator>
    <dc:date>2015-05-22T13:21:11Z</dc:date>
    <item>
      <title>If Logic, Setting one variable = to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218418#M267806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could someone tell me why this code isn't working? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set called "Feb_2", &lt;/P&gt;&lt;P&gt;I'm creating a data set "Feb_3",&lt;/P&gt;&lt;P&gt;Feb_2 has a variable "Net Points" and if it's less than 0 I would like to have a new variable "Net_Point_Adj" set to 0, else if "Net Points" is 0 or greater, I'd like the new variable "Net_Point_Adj" to = the value of "Net Points". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAMPLE 1&lt;/P&gt;&lt;P&gt;DATA Feb_3;&lt;/P&gt;&lt;P&gt;Set Feb_2;&lt;/P&gt;&lt;P&gt;IF Net_Points &amp;lt;0, THEN Net_Point_Adj = 0;&lt;/P&gt;&lt;P&gt;ELSE Net_Points_Adj = Net_Points;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAMPLE 2&lt;/P&gt;&lt;P&gt;DATA Feb_3;&lt;/P&gt;&lt;P&gt;Set Feb_2;&lt;/P&gt;&lt;P&gt;IF Net_Points &amp;lt;0, THEN Net_Point_Adj = 0;&lt;/P&gt;&lt;P&gt;ELSE IF Net_Points_Adj =&amp;gt; 0, THEN Net_Point_Adj = Net_Points;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218418#M267806</guid>
      <dc:creator>GalacticAbacus</dc:creator>
      <dc:date>2015-05-22T13:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: If Logic, Setting one variable = to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218419#M267807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you putting a comma after the value?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;IF Net_Points &amp;lt;0, THEN Net_Point_Adj = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;This is invalid SAS code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;Secondly, may I suggest some code readability:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data Feb_3;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Feb_2;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Net_Points &amp;lt; 0 then Net_Point_Adj=0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else Net_Points_Adj=Net_Points;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218419#M267807</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-22T13:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: If Logic, Setting one variable = to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218420#M267808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added the comma because I was being sloppy &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; Thank you. &lt;/P&gt;&lt;P&gt;And yes I'll be more vigilant in code organization. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 13:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Logic-Setting-one-variable-to-another/m-p/218420#M267808</guid>
      <dc:creator>GalacticAbacus</dc:creator>
      <dc:date>2015-05-22T13:21:11Z</dc:date>
    </item>
  </channel>
</rss>

