<?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: Need Column and row totals of below input in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697451#M213133</link>
    <description>&lt;P&gt;Try next code. If it does not fit what you want, please explain what's wrong:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm='09'x;
input Y1	Y2	X1	X2 ;
cards;
201201	200801	2	3
201201	200802	1	5
201201	200802	0	0
201201	200802	4	11
201201	200802	5	8
201201	200802	8	9
201202	200802	1	3
201202	200803	0	0
201203	200803	4	5
201203	200803	0	0
201204	200804	3	0
201204	200804	0	0
201205	200804	0	0
201205	200804	4	3
201205	200804	0	0
201205	200804	0	0
; run;
proc tabulate data=have ;
class y1 y2;
var x1;
table y2=' ' all='Grand Toatl',
      y1=' '*x1=' '*sum=' '*f=4. all='Grand Total'
 /box='Y2/Y1';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Nov 2020 20:31:00 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-11-08T20:31:00Z</dc:date>
    <item>
      <title>Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697426#M213120</link>
      <description>&lt;P&gt;I/P:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;Y2&lt;/TD&gt;&lt;TD&gt;X1&lt;/TD&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TD&gt;4&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Y1 &amp;amp; Y2 in Row and Columns.&lt;/P&gt;&lt;P&gt;2.Sum(X1) in tabular format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.Row totals and column totals&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 15:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697426#M213120</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2020-11-08T15:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697429#M213122</link>
      <description>&lt;P&gt;Can you please explain this further? How are X1 and X2 used to compute the output? How do you get 4361 in the row 200801 and the column 201201? That's not a sum of anything I can figure out.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In other words, explain the steps that enable you to take the inputs and come up with the outputs.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 13:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697429#M213122</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-08T13:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697430#M213123</link>
      <description>&lt;P&gt;That is transactional data..huge data.. I gave Sample data..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X1=SUM(Y1) Group By Y1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X2=SUM(X2) Group by Y2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;201801 =Sum(201801+201801+20810...)&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>Sun, 08 Nov 2020 13:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697430#M213123</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2020-11-08T13:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697431#M213124</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354671"&gt;@Cho8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That is transactional data..huge data.. I gave Sample data..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, I understand this part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;X1=SUM(Y1) Group By Y1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X2=SUM(X2) Group by Y2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;201801 =Sum(201801+201801+20810...)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This I don't understand at all. Again I ask, how do you compute 4361 in the row 200801 and the column 201201? &lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 14:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697431#M213124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-08T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697434#M213125</link>
      <description>&lt;P&gt;The same question as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;.. Also, di you need this in a SAS data set or a report?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 14:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697434#M213125</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-08T14:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697436#M213126</link>
      <description>&lt;P&gt;I did Excel Pivot to find sum of data for each transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 14:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697436#M213126</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2020-11-08T14:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697437#M213127</link>
      <description>&lt;P&gt;SASDataset&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 14:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697437#M213127</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2020-11-08T14:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697438#M213128</link>
      <description>&lt;P&gt;You need to show us how to take the inputs you in the sample you provided, and then obtain the outputs in the sample you provided. You can't give us answers based upon some other data that we don't have. You haven't answered the very specific questions that I asked, so at this time, I can't help you.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 14:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697438#M213128</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-08T14:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697439#M213129</link>
      <description>&lt;P&gt;I did change the format of data,see if it answers u r Question&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 15:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697439#M213129</guid>
      <dc:creator>Cho8</dc:creator>
      <dc:date>2020-11-08T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697441#M213130</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;How do you compute the number 4361?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Answer that question in detail instead of feeding us terse, meaningless and useless one-liners.&lt;/P&gt;
&lt;P&gt;Show exactly which numbers of the source data contribute to this result, and which calculations are used.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 15:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697441#M213130</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-08T15:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need Column and row totals of below input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697451#M213133</link>
      <description>&lt;P&gt;Try next code. If it does not fit what you want, please explain what's wrong:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dlm='09'x;
input Y1	Y2	X1	X2 ;
cards;
201201	200801	2	3
201201	200802	1	5
201201	200802	0	0
201201	200802	4	11
201201	200802	5	8
201201	200802	8	9
201202	200802	1	3
201202	200803	0	0
201203	200803	4	5
201203	200803	0	0
201204	200804	3	0
201204	200804	0	0
201205	200804	0	0
201205	200804	4	3
201205	200804	0	0
201205	200804	0	0
; run;
proc tabulate data=have ;
class y1 y2;
var x1;
table y2=' ' all='Grand Toatl',
      y1=' '*x1=' '*sum=' '*f=4. all='Grand Total'
 /box='Y2/Y1';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 20:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Column-and-row-totals-of-below-input/m-p/697451#M213133</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-11-08T20:31:00Z</dc:date>
    </item>
  </channel>
</rss>

