<?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: how to sum column  in a Data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615128#M179903</link>
    <description>&lt;P&gt;Define what you mean by "dimension" and supply your example data in a usable form as a data step with datalines, along with an example of your expected output (dataset or report?).&lt;/P&gt;</description>
    <pubDate>Sat, 04 Jan 2020 11:40:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-04T11:40:27Z</dc:date>
    <item>
      <title>how to sum column  in a Data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615091#M179881</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a data set that i will like to reduce the number of rows by summing the values of the each column for certain values of the variable SpdCat (1,2,3,4 and 5), and put it in one row (that i will index 1) of the same dimension. So, each time i see rows that has 1,2,3,4, and 5 as index in the SpdCat column, i want to sum the value of those columns. Here is a screen shot of the data&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture. Data.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35134iD92331C17C31C468/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture. Data.PNG" alt="Capture. Data.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can some one help here?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 22:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615091#M179881</guid>
      <dc:creator>mcbain</dc:creator>
      <dc:date>2020-01-03T22:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum column  in a Data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615092#M179882</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It's not quite clear to me what you want to summarize -- you want to summarize the values of SPDCAT or you want to summarize the values of Data1-Data13??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; What code have you tried? Have you tried PROC MEANS or PROC TABULATE? You can of course, do custom summarizing in a DATA step program have you tried that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I can't visualize what your output would look like. Essentially, you are asking people to duplicate the data in your screen shot in order to help you. Can you post your data as a datalines program so that anyone can create the data and what would also be useful would be seeing an example of what the desired output would look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 22:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615092#M179882</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-01-03T22:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum column  in a Data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615095#M179884</link>
      <description>&lt;P&gt;Thank you mam&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp; as I second to your thoughts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/305449"&gt;@mcbain&lt;/a&gt;&amp;nbsp; I am not sure if i understand your requirement nor I am able to create a sample of what you HAVE and what you WANT, which is generally expected from original posters. You could paste as plain text that is neat for us to copy paste easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, I am gonna take a guess though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
 set have end=z;
 array t(*) data1-data13;
 if spdcat in (1:5) then sum+t(spdcat);
 if z;
 keep sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 22:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615095#M179884</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-03T22:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum column  in a Data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615128#M179903</link>
      <description>&lt;P&gt;Define what you mean by "dimension" and supply your example data in a usable form as a data step with datalines, along with an example of your expected output (dataset or report?).&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2020 11:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-sum-column-in-a-Data-set/m-p/615128#M179903</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-04T11:40:27Z</dc:date>
    </item>
  </channel>
</rss>

