<?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 SQL Tables from sql/data procedures in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77008#M22307</link>
    <description>Good Morning, &lt;BR /&gt;
I'm trying to take multiple tables from a sql and data procedure, which results in 3 tables, and use only the columns I want. &lt;BR /&gt;
The data the gives me the tables are&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 create table mpuep09.pop as&lt;BR /&gt;
 	select strata, count(*) as count, sum(amt_paid) as amount&lt;BR /&gt;
 	from mpuep09.mpuep09_agg10&lt;BR /&gt;
 	group by 1;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
data mpuep09.samp; retain strata paid paid2; set mpuep09.mpuep09_samp; paid2 = paid; run;&lt;BR /&gt;
&lt;BR /&gt;
%srs_extrap(mpuep09.samp,mpuep09.pop,method=100000,estimate=audited);&lt;BR /&gt;
&lt;BR /&gt;
Does anybody have any insight?&lt;BR /&gt;
Thank you!</description>
    <pubDate>Mon, 16 Mar 2009 13:58:55 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-03-16T13:58:55Z</dc:date>
    <item>
      <title>SQL Tables from sql/data procedures</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77008#M22307</link>
      <description>Good Morning, &lt;BR /&gt;
I'm trying to take multiple tables from a sql and data procedure, which results in 3 tables, and use only the columns I want. &lt;BR /&gt;
The data the gives me the tables are&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 create table mpuep09.pop as&lt;BR /&gt;
 	select strata, count(*) as count, sum(amt_paid) as amount&lt;BR /&gt;
 	from mpuep09.mpuep09_agg10&lt;BR /&gt;
 	group by 1;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
data mpuep09.samp; retain strata paid paid2; set mpuep09.mpuep09_samp; paid2 = paid; run;&lt;BR /&gt;
&lt;BR /&gt;
%srs_extrap(mpuep09.samp,mpuep09.pop,method=100000,estimate=audited);&lt;BR /&gt;
&lt;BR /&gt;
Does anybody have any insight?&lt;BR /&gt;
Thank you!</description>
      <pubDate>Mon, 16 Mar 2009 13:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77008#M22307</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T13:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Tables from sql/data procedures</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77009#M22308</link>
      <description>Could you be more specific?&lt;BR /&gt;
&lt;BR /&gt;
I have read this several times and have no idea what it is ou are asking.</description>
      <pubDate>Mon, 16 Mar 2009 14:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77009#M22308</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-16T14:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Tables from sql/data procedures</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77010#M22309</link>
      <description>Firstly in the future and for the sanity of yourself and anyone else who may have to read your code, have only one semi-colon per line. It makes it so much easier to read. i.e.&lt;BR /&gt;
&lt;BR /&gt;
data mpuep09.samp; &lt;BR /&gt;
retain strata paid paid2; &lt;BR /&gt;
set mpuep09.mpuep09_samp; &lt;BR /&gt;
  paid2 = paid; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
In the most simple example to get only the columns you want you would simply do:&lt;BR /&gt;
&lt;BR /&gt;
data data_i_am_interested_in(keep=column1 column2 etc);&lt;BR /&gt;
set table1 table2 table3;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
But I suspect you are after something a little more complicated. Can you give us example of the data in each of the tables. Do you want to do a merge or an append?&lt;BR /&gt;
&lt;BR /&gt;
Cheers&lt;BR /&gt;
Peter</description>
      <pubDate>Mon, 16 Mar 2009 14:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Tables-from-sql-data-procedures/m-p/77010#M22309</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T14:21:27Z</dc:date>
    </item>
  </channel>
</rss>

