<?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: combining tables vertically - resut output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572153#M161449</link>
    <description>&lt;P&gt;Drop the OUTER and let UNION work as intended.&lt;/P&gt;
&lt;P&gt;If you want to impose an order than spell it out.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select  "TOTAL" as sex 
       , sum(weight) as weight format comma.
       ,  1 as ordervar
  from sashelp.class
union
  select sex
       , sum(weight) as weight format comma.
       , 2 as ordervar
  from sashelp.class
  group by sex
  order by ordervar, sex
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Jul 2019 16:53:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-09T16:53:32Z</dc:date>
    <item>
      <title>combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572134#M161438</link>
      <description>&lt;P&gt;Hy,&lt;/P&gt;&lt;P&gt;I'm running this program:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select  "TOTAL" as dest,
			sum(Boarded) as Boarded format comma.
 	from sasuser.LAGUARDIA
 		outer union  
		 	select Dest,
		 		   sum(Boarded) as Boarded format comma.
		 	from sasuser.LAGUARDIA
		 	group by Dest;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and SAS shows me this result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.PNG" style="width: 230px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30885i76C696277837E884/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="Capture3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd like to see the result of the first query (total boarded) just under the result of the second query (total boarded group by destination) without missing data. Something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3bis.png" style="width: 230px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30886i23CEBA4A4CEB897C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3bis.png" alt="Capture3bis.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it possible? If yes, could you help me...thank a lot!&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Daniele&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 15:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572134#M161438</guid>
      <dc:creator>Ccasagran737</dc:creator>
      <dc:date>2019-07-09T15:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572139#M161441</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/175761"&gt;@Ccasagran737&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using &lt;STRONG&gt;UNION instead of OUTER UNION&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572139#M161441</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-09T16:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572140#M161442</link>
      <description>&lt;P&gt;Well, with the above being said, if you still want to force OUTER UNION to overlay columns corresponding to the first select query, then&lt;/P&gt;
&lt;P&gt;try &lt;STRONG&gt;OUTER UNION Corr&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But please restrain such practices in a production code.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572140#M161442</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-09T16:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572141#M161443</link>
      <description>Do you have to use PROC SQL? Tabulate wold be more appropriate here.</description>
      <pubDate>Tue, 09 Jul 2019 16:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572141#M161443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-09T16:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572150#M161447</link>
      <description>proc tabulate data=sashelp.baseball;&lt;BR /&gt;class Team ;&lt;BR /&gt;var salary;&lt;BR /&gt;table (all = 'Total' team =''), Salary*Sum*f=dollar20. ;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572150#M161447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-09T16:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: combining tables vertically - resut output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572153#M161449</link>
      <description>&lt;P&gt;Drop the OUTER and let UNION work as intended.&lt;/P&gt;
&lt;P&gt;If you want to impose an order than spell it out.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select  "TOTAL" as sex 
       , sum(weight) as weight format comma.
       ,  1 as ordervar
  from sashelp.class
union
  select sex
       , sum(weight) as weight format comma.
       , 2 as ordervar
  from sashelp.class
  group by sex
  order by ordervar, sex
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combining-tables-vertically-resut-output/m-p/572153#M161449</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-09T16:53:32Z</dc:date>
    </item>
  </channel>
</rss>

