<?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 SAS Tip: ABS and SUMABS Functions in SAS Tips from the Community</title>
    <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-ABS-and-SUMABS-Functions/m-p/441719#M126</link>
    <description>&lt;P&gt;The &lt;A href="http://go.documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0xkrj83an7dknn1sgukpmnphcje.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;ABS function&lt;/A&gt; can be used to return a positive value...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE lang="sas"&gt;DATA POSITIVE_INTEGER;
  VALUE = abs(-789);
RUN;

PROC PRINT;RUN;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="http://go.documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0qjybpudgm3ykn110wgqnuj4e03.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;SUMABS function is also available&lt;/A&gt;, and computes the sum of the absolute value of the non-missing arguments.&amp;nbsp; This example returns a value of 14.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE lang="sas"&gt;DATA POSITIVE_INTEGER;
 VALUE = sumabs(-1, 3, 0, ., -10);
RUN;

PROC PRINT;RUN;&lt;/PRE&gt;
&lt;P&gt;You can also use the&amp;nbsp;&lt;STRONG&gt;OF&lt;/STRONG&gt; variable range syntax to include all variables that match a pattern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x1=1;
   x2=3;
   x3=4;
   x4=3;
   x5=1;
   x=sumabs(of x1-x5);
   put x=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;
&lt;P&gt;Thanks to Ayetullah&amp;nbsp;for sharing this tip on sasCommunity.org.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Mar 2018 19:30:50 GMT</pubDate>
    <dc:creator>SAS_Tipster</dc:creator>
    <dc:date>2018-03-08T19:30:50Z</dc:date>
    <item>
      <title>SAS Tip: ABS and SUMABS Functions</title>
      <link>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-ABS-and-SUMABS-Functions/m-p/441719#M126</link>
      <description>&lt;P&gt;The &lt;A href="http://go.documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0xkrj83an7dknn1sgukpmnphcje.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;ABS function&lt;/A&gt; can be used to return a positive value...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE lang="sas"&gt;DATA POSITIVE_INTEGER;
  VALUE = abs(-789);
RUN;

PROC PRINT;RUN;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="http://go.documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0qjybpudgm3ykn110wgqnuj4e03.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;SUMABS function is also available&lt;/A&gt;, and computes the sum of the absolute value of the non-missing arguments.&amp;nbsp; This example returns a value of 14.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE lang="sas"&gt;DATA POSITIVE_INTEGER;
 VALUE = sumabs(-1, 3, 0, ., -10);
RUN;

PROC PRINT;RUN;&lt;/PRE&gt;
&lt;P&gt;You can also use the&amp;nbsp;&lt;STRONG&gt;OF&lt;/STRONG&gt; variable range syntax to include all variables that match a pattern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x1=1;
   x2=3;
   x3=4;
   x4=3;
   x5=1;
   x=sumabs(of x1-x5);
   put x=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;
&lt;P&gt;Thanks to Ayetullah&amp;nbsp;for sharing this tip on sasCommunity.org.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 19:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-ABS-and-SUMABS-Functions/m-p/441719#M126</guid>
      <dc:creator>SAS_Tipster</dc:creator>
      <dc:date>2018-03-08T19:30:50Z</dc:date>
    </item>
  </channel>
</rss>

