<?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: Create an enumeration variable with a condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192934#M14713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should initialize before you increment. :smileylaugh: AND you need do; posi=0; nega=0; end; not and.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 20:23:21 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2015-01-22T20:23:21Z</dc:date>
    <item>
      <title>Create an enumeration variable with a condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192933#M14712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I want to create a variable to count the number of values greater than 0 and another one for values less than 0. This is my code, but it is not working for the first register of the category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.cb_dc6; &lt;/P&gt;&lt;P&gt;set work.cb_dc5;&lt;/P&gt;&lt;P&gt;by block;&lt;/P&gt;&lt;P&gt;if (dif&amp;gt;=0) then posi+1;&lt;/P&gt;&lt;P&gt;if (dif&amp;lt;0) then nega+1;&lt;/P&gt;&lt;P&gt;if first.block then posi=0 and nega=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look register #1 CRETEXT1, column posi should begin with 1 no 0. Same problem with register 10 ALICORC1, register 10 for nega column should be 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/8825_pastedImage_1.png" style="width: 875px; height: 592px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; any idea? Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 20:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192933#M14712</guid>
      <dc:creator>fri0</dc:creator>
      <dc:date>2015-01-22T20:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create an enumeration variable with a condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192934#M14713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should initialize before you increment. :smileylaugh: AND you need do; posi=0; nega=0; end; not and.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 20:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192934#M14713</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-01-22T20:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create an enumeration variable with a condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192935#M14714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure about what you try to say, this is the change, same problem =(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.cb_dc6; &lt;/P&gt;&lt;P&gt;set work.cb_dc5;&lt;/P&gt;&lt;P&gt;by block;&lt;/P&gt;&lt;P&gt;retain posi nega;&lt;/P&gt;&lt;P&gt;if (dif&amp;gt;=0) then posi+1;&lt;/P&gt;&lt;P&gt;if first.block then posi=0;&lt;/P&gt;&lt;P&gt;if (dif&amp;lt;0) then nega+1;&lt;/P&gt;&lt;P&gt;if first.block then nega=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 20:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192935#M14714</guid>
      <dc:creator>fri0</dc:creator>
      <dc:date>2015-01-22T20:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create an enumeration variable with a condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192936#M14715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set your variables to 0 before you increment them otherwise you're setting them after but not incrementing the variables you need to keep track of. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data work.cb_dc6; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;set work.cb_dc5;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;by block;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;retain posi nega;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if first.block then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; posi=0; nega=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (dif&amp;gt;=0) then posi+1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (dif&amp;lt;0) then nega+1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 20:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192936#M14715</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-22T20:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create an enumeration variable with a condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192937#M14716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh! now I understand it! Thank your very much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 20:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-an-enumeration-variable-with-a-condition/m-p/192937#M14716</guid>
      <dc:creator>fri0</dc:creator>
      <dc:date>2015-01-22T20:46:32Z</dc:date>
    </item>
  </channel>
</rss>

