<?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: sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376316#M90319</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144104"&gt;@vinod4842&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;835 proc sql;&lt;BR /&gt;836 create table cadd as select 'ARVIND CHATURVEDI Total' as SH_NAME,sum(INWARDDAY)as INWARDDAY,&lt;BR /&gt;837 sum(INWARDLMON) as INWARDLMON,sum(d1) as d1, sum(NCADAY) as NCADAY,sum(NCAMON) as NCAMON,&lt;BR /&gt;837! sum(NCALMON) as NCALMON,&lt;BR /&gt;838 sum(d2) as d2, 5 as sno from work.c where team=1&lt;BR /&gt;839 union all&lt;BR /&gt;840 select 'SAROJ SAMAL Total' as TM_NAME,sum(sum(INWARDDAY))as INWARDDAY,sum(sum(INWARDLMON)) as&lt;BR /&gt;840! INWARDLMON,&lt;BR /&gt;841 &lt;STRONG&gt;&lt;FONT color="#993366"&gt;sum(sum(d1)) as d1,&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;sum(sum(NCADAY)) as NCADAY,&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;sum(sum(NCAMON)) as NCAMON&lt;/FONT&gt;&lt;/STRONG&gt;, sum(sum(NCALMON)) as&lt;BR /&gt;841! NCALMON,sum(sum(d2)) as d2 ,5 as sno&lt;BR /&gt;842 from work.c where team=1;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: Summary functions nested in this way are not supported.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;843 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it showing error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have invalid syntax and I've highlighted the cause of the errors. What are you trying to do? Post sample data and expected output. And you know, maybe a short description of what the issue is besides 'is showing error'. That doesn't provide any information.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Jul 2017 07:48:40 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-07-16T07:48:40Z</dc:date>
    <item>
      <title>SQL Error - Summary functions nested are not supported</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376315#M90318</link>
      <description>&lt;P&gt;835 proc sql;&lt;BR /&gt;836 create table cadd as select 'ARVIND CHATURVEDI Total' as SH_NAME,sum(INWARDDAY)as INWARDDAY,&lt;BR /&gt;837 sum(INWARDLMON) as INWARDLMON,sum(d1) as d1, sum(NCADAY) as NCADAY,sum(NCAMON) as NCAMON,&lt;BR /&gt;837! sum(NCALMON) as NCALMON,&lt;BR /&gt;838 sum(d2) as d2, 5 as sno from work.c where team=1&lt;BR /&gt;839 union all&lt;BR /&gt;840 select 'SAROJ SAMAL Total' as TM_NAME,sum(sum(INWARDDAY))as INWARDDAY,sum(sum(INWARDLMON)) as&lt;BR /&gt;840! INWARDLMON,&lt;BR /&gt;841 sum(sum(d1)) as d1, sum(sum(NCADAY)) as NCADAY,sum(sum(NCAMON)) as NCAMON, sum(sum(NCALMON)) as&lt;BR /&gt;841! NCALMON,sum(sum(d2)) as d2 ,5 as sno&lt;BR /&gt;842 from work.c where team=1;&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;843 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it showing error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2017 07:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376315#M90318</guid>
      <dc:creator>vinod4842</dc:creator>
      <dc:date>2017-07-16T07:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376316#M90319</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144104"&gt;@vinod4842&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;835 proc sql;&lt;BR /&gt;836 create table cadd as select 'ARVIND CHATURVEDI Total' as SH_NAME,sum(INWARDDAY)as INWARDDAY,&lt;BR /&gt;837 sum(INWARDLMON) as INWARDLMON,sum(d1) as d1, sum(NCADAY) as NCADAY,sum(NCAMON) as NCAMON,&lt;BR /&gt;837! sum(NCALMON) as NCALMON,&lt;BR /&gt;838 sum(d2) as d2, 5 as sno from work.c where team=1&lt;BR /&gt;839 union all&lt;BR /&gt;840 select 'SAROJ SAMAL Total' as TM_NAME,sum(sum(INWARDDAY))as INWARDDAY,sum(sum(INWARDLMON)) as&lt;BR /&gt;840! INWARDLMON,&lt;BR /&gt;841 &lt;STRONG&gt;&lt;FONT color="#993366"&gt;sum(sum(d1)) as d1,&lt;/FONT&gt; &lt;FONT color="#FF6600"&gt;sum(sum(NCADAY)) as NCADAY,&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;sum(sum(NCAMON)) as NCAMON&lt;/FONT&gt;&lt;/STRONG&gt;, sum(sum(NCALMON)) as&lt;BR /&gt;841! NCALMON,sum(sum(d2)) as d2 ,5 as sno&lt;BR /&gt;842 from work.c where team=1;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: Summary functions nested in this way are not supported.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;ERROR: Summary functions nested in this way are not supported.&lt;BR /&gt;843 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it showing error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have invalid syntax and I've highlighted the cause of the errors. What are you trying to do? Post sample data and expected output. And you know, maybe a short description of what the issue is besides 'is showing error'. That doesn't provide any information.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2017 07:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376316#M90319</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-16T07:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Error - Summary functions nested are not supported</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376319#M90320</link>
      <description>id name age sub1 sub2 sub3&lt;BR /&gt;1 abc 13 60 50 60&lt;BR /&gt;2 cde 13 70 50 66&lt;BR /&gt;3 def 14 66 71 63&lt;BR /&gt;4 poe 15 99 36 41&lt;BR /&gt;5 wec 16 44 66 65&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;expecting result;&lt;BR /&gt;id name age sub1 sub2 sub3;&lt;BR /&gt;1 abc 13 60 50 60&lt;BR /&gt;2 cde 13 70 50 66&lt;BR /&gt;sub tot 130 100 126&lt;BR /&gt;tot 130 100 126&lt;BR /&gt;3 def 14 66 71 63&lt;BR /&gt;4 poe 15 99 36 41&lt;BR /&gt;sub tot 165 107 104&lt;BR /&gt;tol 295 207 230&lt;BR /&gt;5 wec 16 44 66 65&lt;BR /&gt;sub tot 44 66 65&lt;BR /&gt;tot 44 66 65&lt;BR /&gt;grand tot 339 273 295</description>
      <pubDate>Sun, 16 Jul 2017 08:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376319#M90320</guid>
      <dc:creator>vinod4842</dc:creator>
      <dc:date>2017-07-16T08:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Error - Summary functions nested are not supported</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376320#M90321</link>
      <description>&lt;P&gt;If this is for display use PROC REPORT. If for creating a summary table, look at PROC MEANS with the MULTILABEL format option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144104"&gt;@vinod4842&lt;/a&gt; wrote:&lt;BR /&gt;id name age sub1 sub2 sub3&lt;BR /&gt;1 abc 13 60 50 60&lt;BR /&gt;2 cde 13 70 50 66&lt;BR /&gt;3 def 14 66 71 63&lt;BR /&gt;4 poe 15 99 36 41&lt;BR /&gt;5 wec 16 44 66 65&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;expecting result;&lt;BR /&gt;id name age sub1 sub2 sub3;&lt;BR /&gt;1 abc 13 60 50 60&lt;BR /&gt;2 cde 13 70 50 66&lt;BR /&gt;sub tot 130 100 126&lt;BR /&gt;tot 130 100 126&lt;BR /&gt;3 def 14 66 71 63&lt;BR /&gt;4 poe 15 99 36 41&lt;BR /&gt;sub tot 165 107 104&lt;BR /&gt;tol 295 207 230&lt;BR /&gt;5 wec 16 44 66 65&lt;BR /&gt;sub tot 44 66 65&lt;BR /&gt;tot 44 66 65&lt;BR /&gt;grand tot 339 273 295&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2017 08:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376320#M90321</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-16T08:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Error - Summary functions nested are not supported</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376388#M90352</link>
      <description>&lt;P&gt;You don't seem to have any grouping variables in your example data that would allow for calculating subtotals and totals. So first let's just make some so we have something to demonstrate with.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data expect ;
  input group subgroup id name :$20. age sub1 sub2 sub3;
cards;
1 1 1 abc 13 60 50 60
1 1 2 cde 13 70 50 66
1 1 . sub_total . 130 100 126
1 . . total . 130 100 126
2 1 3 def 14 66 71 63
2 1 4 poe 15 99 36 41
2 1 . sub_total . 165 107 104
2 . . total . 295 207 230
3 1 5 wec 16 44 66 65
3 1 . sub_total . 44 66 65
3 . . total . 44 66 65
. . . grand_total . 339 273 295
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now we can just throw out the summary lines to get some example INPUT data that we can use the test our program.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  set expect ;
  where age^=. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now if you want to do this with PROC SQL then just UNION the queries that create the different types of rows. &amp;nbsp;It would be nice if we could make the output sort into the order that you presented. For now I will just use some arbitraryly large values for the GROUP, SUBGROUP and ID variables to make that work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
  create table want as
  select * from have
  union
  select group,subgroup,9999 as id,'sub_total' as name,. as age
       , sum(sub1) as sub1
       , sum(sub2) as sub2
       , sum(sub3) as sub3
  from have group by group,subgroup
  union
  select group,9999 as subgroup,9999 as id,'total' as name,. as age
       , sum(sub1) as sub1
       , sum(sub2) as sub2
       , sum(sub3) as sub3
  from have group by group
  union
  select 9999 as group,9999 as subgroup,9999 as id,'grand_total' as name,. as age
       , sum(sub1) as sub1
       , sum(sub2) as sub2
       , sum(sub3) as sub3
  from have
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2017 00:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Error-Summary-functions-nested-are-not-supported/m-p/376388#M90352</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-17T00:29:28Z</dc:date>
    </item>
  </channel>
</rss>

