<?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 positive and negative values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736726#M229566</link>
    <description>&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;input number;&lt;/P&gt;
&lt;P&gt;-100&lt;/P&gt;
&lt;P&gt;-200&lt;/P&gt;
&lt;P&gt;100&lt;/P&gt;
&lt;P&gt;200&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;using data have .i want to create two variable one with positive value&amp;nbsp; and other with negative value&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output should be like&lt;/P&gt;
&lt;P&gt;negative&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;positive&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;-200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: nondescriptive subject line ("sas"!) changed by KB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 24 Apr 2021 09:04:47 GMT</pubDate>
    <dc:creator>aanan1417</dc:creator>
    <dc:date>2021-04-24T09:04:47Z</dc:date>
    <item>
      <title>positive and negative values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736726#M229566</link>
      <description>&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;input number;&lt;/P&gt;
&lt;P&gt;-100&lt;/P&gt;
&lt;P&gt;-200&lt;/P&gt;
&lt;P&gt;100&lt;/P&gt;
&lt;P&gt;200&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;using data have .i want to create two variable one with positive value&amp;nbsp; and other with negative value&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output should be like&lt;/P&gt;
&lt;P&gt;negative&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;positive&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;-200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: nondescriptive subject line ("sas"!) changed by KB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 09:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736726#M229566</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2021-04-24T09:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: positive and negative values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736728#M229568</link>
      <description>&lt;P&gt;Use the ABS() function to get the absolute value for positive, and multiply it with -1 to get the negative.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS you were asked for a descriptive subject line when posting the question. "sas" is not descriptive, it's simply stupid when posting in the &lt;STRONG&gt;SAS&lt;/STRONG&gt; Communities.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 09:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736728#M229568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-24T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: positive and negative values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736737#M229577</link>
      <description>&lt;P&gt;Your DATA step is missing a DATALINES statement.&lt;/P&gt;
&lt;P&gt;You don't say what you want to happen if the data contains 0, but here is one approach. I assume you want all the positive values to be in one column and all negative values to be in another column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
input number;
datalines;
-100
-200
10
20
57
-43
-64
0
;

data Pos Neg;
set Have;
if      number &amp;gt; 0 then output Pos;
else if number &amp;lt; 0 then output Neg;
else put "Warning: 0 was found";
run;

data Want;
merge Pos(rename=(Number=Positive)) 
      Neg(rename=(Number=Negative));
run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 11:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736737#M229577</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-04-24T11:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: positive and negative values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736740#M229578</link>
      <description>&lt;P&gt;You apparently want to merge the first positive number with the first negative, the second positive with the second negative, etc.&lt;/P&gt;
&lt;P&gt;In addition to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;'s question about what you want to do with zeroes, what to you want to do with excess positives or excess negative?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 12:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/positive-and-negative-values/m-p/736740#M229578</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-04-24T12:26:03Z</dc:date>
    </item>
  </channel>
</rss>

