<?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: Sum of numeric fields along row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482951#M125175</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The issue is that I have a dynamic program that run every month.&lt;BR /&gt;Number of fields are increasing every month.&lt;BR /&gt;So actually i want to calculate sum along row with non fix number of fields.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means your data model is wrong. As I believe has been mentioned a time or two.&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jul 2018 21:38:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-31T21:38:47Z</dc:date>
    <item>
      <title>Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482941#M125170</link>
      <description>Hello&lt;BR /&gt;I want to calculate all numeric vars along a row.&lt;BR /&gt;Is there a way to tell sas to calculate in each row(observation)&lt;BR /&gt;Sum of all numeric values?&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482941#M125170</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-07-31T21:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482943#M125171</link>
      <description>The issue is that I have a dynamic program that run every month.&lt;BR /&gt;Number of fields are increasing every month.&lt;BR /&gt;So actually i want to calculate sum along row with non fix number of fields.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482943#M125171</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-07-31T21:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482945#M125172</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var1 var2 var3;
cards;
1 2 3
4 5 6
7 8 9
;
data want;
set have;
sum=sum(of _numeric_);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;you mean this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;sum=sum(of _numeric_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482945#M125172</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-31T21:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482951#M125175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The issue is that I have a dynamic program that run every month.&lt;BR /&gt;Number of fields are increasing every month.&lt;BR /&gt;So actually i want to calculate sum along row with non fix number of fields.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means your data model is wrong. As I believe has been mentioned a time or two.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482951#M125175</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-31T21:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482984#M125191</link>
      <description>&lt;P&gt;If you can't use _numeric_ as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; - because you have numeric vars that should not be part of the calculation - then all variables need a common prefix, so that you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sum = sum(of prefix:)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But fixing the data-structure as recommended by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; is the best way to solve the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 05:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/482984#M125191</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-08-01T05:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of numeric fields along row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/483089#M125235</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;If you can't use _numeric_ as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; - because you have numeric vars that should not be part of the calculation - then all variables need a common prefix, so that you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sum = sum(of prefix:)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But fixing the data-structure as recommended by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; is the best way to solve the issue.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;or if you have several "prefixes"&lt;/P&gt;
&lt;P&gt;sum = sum( of prefix: , of other: , of different: );&lt;/P&gt;
&lt;P&gt;or if all of the variables of interest are sequential in column order&lt;/P&gt;
&lt;P&gt;sum = sum( firstvar -- lastvar); There are two -&amp;nbsp;&amp;nbsp; in case your browser makes it hard to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for stuff like this providing an example layout of your data and indicating which variables you wanted to sum does not seem unrealistic to ask.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 15:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-of-numeric-fields-along-row/m-p/483089#M125235</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-01T15:25:02Z</dc:date>
    </item>
  </channel>
</rss>

