<?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 by in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3617#M1551</link>
    <description>Hi:&lt;BR /&gt;
  I don't see a correlation between table A and what you want in table B. Did you mean, perhaps that the data in A was:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data A; /*var: age , note*/&lt;BR /&gt;
ageA 2&lt;BR /&gt;
ageA 5&lt;BR /&gt;
ageB 2&lt;BR /&gt;
ageB 4&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;B&gt;OR&lt;/B&gt;&lt;BR /&gt;
data A; /*var: age , note*/&lt;BR /&gt;
age1 2 A&lt;BR /&gt;
age2 5 A&lt;BR /&gt;
age3 2 B&lt;BR /&gt;
age4 4 B&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
It's hard to visualize the input data. And if you are talking about SUMBY, you're talking about PROC PRINT. If you're talking about using ageA and ageB as groups, then you're talking about PROC REPORT. So, I'm confused because you said you wanted to use the DATA step to get B -- is B a table or is B a report? Depending on what your INPUT data looks like (table A), the answer will depend on 1) the INPUT data and 2) what you want to get as output -- a table or a report.&lt;BR /&gt;
  &lt;BR /&gt;
And, if this is a DATA step program question and not an ODS/Reporting question, your best bet for help is to contact Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 26 Jun 2007 15:16:41 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2007-06-26T15:16:41Z</dc:date>
    <item>
      <title>sum by</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3616#M1550</link>
      <description>I want to know if you have table A&lt;BR /&gt;
data A;                 /*var: age , note*/&lt;BR /&gt;
age1 2&lt;BR /&gt;
age2 5&lt;BR /&gt;
age3 2&lt;BR /&gt;
age4 4&lt;BR /&gt;
&lt;BR /&gt;
well i want to create data B;&lt;BR /&gt;
with :&lt;BR /&gt;
data B;&lt;BR /&gt;
ageA  7&lt;BR /&gt;
ageB  6&lt;BR /&gt;
&lt;BR /&gt;
by using data step</description>
      <pubDate>Tue, 26 Jun 2007 14:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3616#M1550</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-06-26T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: sum by</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3617#M1551</link>
      <description>Hi:&lt;BR /&gt;
  I don't see a correlation between table A and what you want in table B. Did you mean, perhaps that the data in A was:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data A; /*var: age , note*/&lt;BR /&gt;
ageA 2&lt;BR /&gt;
ageA 5&lt;BR /&gt;
ageB 2&lt;BR /&gt;
ageB 4&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;B&gt;OR&lt;/B&gt;&lt;BR /&gt;
data A; /*var: age , note*/&lt;BR /&gt;
age1 2 A&lt;BR /&gt;
age2 5 A&lt;BR /&gt;
age3 2 B&lt;BR /&gt;
age4 4 B&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
It's hard to visualize the input data. And if you are talking about SUMBY, you're talking about PROC PRINT. If you're talking about using ageA and ageB as groups, then you're talking about PROC REPORT. So, I'm confused because you said you wanted to use the DATA step to get B -- is B a table or is B a report? Depending on what your INPUT data looks like (table A), the answer will depend on 1) the INPUT data and 2) what you want to get as output -- a table or a report.&lt;BR /&gt;
  &lt;BR /&gt;
And, if this is a DATA step program question and not an ODS/Reporting question, your best bet for help is to contact Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 26 Jun 2007 15:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3617#M1551</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-06-26T15:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: sum by</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3618#M1552</link>
      <description>i mean:&lt;BR /&gt;
i explain:&lt;BR /&gt;
data A;&lt;BR /&gt;
with 2 variables :  age effectif&lt;BR /&gt;
observations are:&lt;BR /&gt;
age1 50&lt;BR /&gt;
age2 75&lt;BR /&gt;
age3 25&lt;BR /&gt;
age4 10&lt;BR /&gt;
age5 10&lt;BR /&gt;
age6 5&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
agei&lt;BR /&gt;
.&lt;BR /&gt;
age99&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i want to create data B&lt;BR /&gt;
with variables gr_age effectif&lt;BR /&gt;
and the first observation will be equal to:  gr_age1 sum(age1-age4)&lt;BR /&gt;
and the second will be equal to :             gr_age2 sum (age5-age9)&lt;BR /&gt;
......&lt;BR /&gt;
&lt;BR /&gt;
data B &lt;BR /&gt;
gr_age1  160&lt;BR /&gt;
gr_age2   ..&lt;BR /&gt;
&lt;BR /&gt;
after i want data B will be in a sheet of Excel &lt;BR /&gt;
&lt;BR /&gt;
thanx</description>
      <pubDate>Tue, 26 Jun 2007 15:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3618#M1552</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-06-26T15:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: sum by</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3619#M1553</link>
      <description>This does not quite sound like an ODS question. It sounds to me like you want to sum every 4 or 5 observations? Or something like that. I think your best bet for a quick response might be to contact Tech Support:&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/contact/index.html" target="_blank"&gt;http://support.sas.com/techsup/contact/index.html&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 26 Jun 2007 15:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/sum-by/m-p/3619#M1553</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-06-26T15:50:03Z</dc:date>
    </item>
  </channel>
</rss>

