<?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 how to get total of variable through data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568139#M159875</link>
    <description>&lt;P&gt;&lt;BR /&gt;data test ;&lt;BR /&gt;input x;&lt;BR /&gt;datalines;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;Q) how can I get total of x in single observation ?&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jun 2019 17:51:06 GMT</pubDate>
    <dc:creator>karan96</dc:creator>
    <dc:date>2019-06-22T17:51:06Z</dc:date>
    <item>
      <title>how to get total of variable through data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568139#M159875</link>
      <description>&lt;P&gt;&lt;BR /&gt;data test ;&lt;BR /&gt;input x;&lt;BR /&gt;datalines;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;Q) how can I get total of x in single observation ?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 17:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568139#M159875</guid>
      <dc:creator>karan96</dc:creator>
      <dc:date>2019-06-22T17:51:06Z</dc:date>
    </item>
    <item>
      <title>how to get total of variable through data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568138#M159878</link>
      <description>&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;input x;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Q) how can I get total of x&amp;nbsp; in single observation ?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 17:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568138#M159878</guid>
      <dc:creator>karan96</dc:creator>
      <dc:date>2019-06-22T17:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to get total of variable through data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568140#M159876</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276777"&gt;@karan96&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Any of the steps 2 through 4 below will work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;                                               
  input x ;                                               
  cards ;                                                 
1                                                         
2                                                         
3                                                         
4                                                         
5                                                         
6                                                         
7                                                         
;                                                         
run ;                                                     
                                                         
data need (drop = x) ;                                    
  set test end = z ;                                      
  sum_x + x ;                                             
  if z ;                                                  
run ;                                                     
                                                          
proc sql ;                                                
  create table need as select sum (x) as sum_x from test ;
quit ;                                                    
                                                         
proc means data = test noprint ;                          
  var x ;                                                 
  output out = need (drop = _:) sum = sum_x ;             
run ;                                                     
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 18:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-total-of-variable-through-data-step/m-p/568140#M159876</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-06-22T18:15:10Z</dc:date>
    </item>
  </channel>
</rss>

