<?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: convert set statements into sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647359#M193731</link>
    <description>&lt;P&gt;ok, thanks..will try&lt;/P&gt;&lt;P&gt;apart from union,&lt;/P&gt;&lt;P&gt;is it there ahything similar in sql joins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i ned something from sql join&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 08:11:18 GMT</pubDate>
    <dc:creator>chithra</dc:creator>
    <dc:date>2020-05-13T08:11:18Z</dc:date>
    <item>
      <title>convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647357#M193729</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to convert the below statement into procsql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.W10Z35LY;&lt;BR /&gt;set work.W10Y7DVC&lt;BR /&gt;work.W10VUM5G;&lt;BR /&gt;keep A,B,C;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 08:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647357#M193729</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2020-05-13T08:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647358#M193730</link>
      <description>&lt;P&gt;You can try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table work.W10Z35LY as select A,B,C from work.W10Y7DVC
union all
select A,B,C from work.W10VUM5G;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 08:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647358#M193730</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-05-13T08:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647359#M193731</link>
      <description>&lt;P&gt;ok, thanks..will try&lt;/P&gt;&lt;P&gt;apart from union,&lt;/P&gt;&lt;P&gt;is it there ahything similar in sql joins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i ned something from sql join&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 08:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647359#M193731</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2020-05-13T08:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647360#M193732</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/54638"&gt;@chithra&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You data step shows a concatenation of two datasets, not a merge.&lt;/P&gt;
&lt;P&gt;What should be the join key?&lt;/P&gt;
&lt;P&gt;Please post some sample data in datelines.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 08:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647360#M193732</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-05-13T08:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647368#M193737</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/54638"&gt;@chithra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;ok, thanks..will try&lt;/P&gt;
&lt;P&gt;apart from union,&lt;/P&gt;
&lt;P&gt;is it there ahything similar in sql joins?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i ned something from sql join&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A concatenation (that's what your data step code does) is done with a UNION in SQL, not with a join, period. Since UNION code takes a lot more typing than a SET with multiple datasets, the data step is the tool of choice for concatenations.&lt;/P&gt;
&lt;P&gt;There are also considerations to be done if not all columns are present in all datasets. Once again, the data step is much simpler here.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 08:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647368#M193737</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-13T08:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647399#M193764</link>
      <description>&lt;P&gt;Can you please describe the requirement?&lt;/P&gt;
&lt;P&gt;It's very specific that you need a SQL join...?&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 10:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647399#M193764</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2020-05-13T10:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647706#M193868</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Union all works here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i need the final outpout to be stored in oracle using proc sql.&lt;/P&gt;&lt;P&gt;And it is slow here. compared to data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 06:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647706#M193868</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2020-05-14T06:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647710#M193871</link>
      <description>&lt;P&gt;So it took a thread with 6 replies for you to come up with the&amp;nbsp;&lt;EM&gt;very crucial&lt;/EM&gt; information that you work with a remote DBMS.&lt;/P&gt;
&lt;P&gt;Please be more complete in supplying the necessary information when you post questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all your tables reside on Oracle, then you should execute the SQL UNION in explicit passthrough.&lt;/P&gt;
&lt;P&gt;If you need to append data from SAS to existing Oracle tables, use proc append, or upload the data to Oracle and do the UNION there.&lt;/P&gt;
&lt;P&gt;If all your source tables reside in SAS, and only the end result needs to be in Oracle, use the DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The network transfer rate between the SAS and Oracle servers will be the deciding factor when it comes to performance if you need to move data between the two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before we go on, you need to tell us&amp;nbsp;&lt;EM&gt;exactly&lt;/EM&gt; what you want to do, and supply table locations and sizes (in terms of observation numbers).&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647710#M193871</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T07:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: convert set statements into sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647751#M193894</link>
      <description>&lt;P&gt;As the output is a simple concatenation, another possibility is to use an INSERT for the second input table, instead of a UNION:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table work.W10Z35LY as select a,b,c from work.W10Y7DVC;
  insert into work.W10Z35LY select a,b,c from work.W10VUM5G;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If both your inputs and your output are in Oracle, you may improve performance by using pass-through SQL, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  connect to Oracle &amp;lt;connect options&amp;gt;;
  execute by oracle(
    create table W10Z35LY as select a,b,c from W10Y7DVC
    );
  execute by oracle(
    insert into W10Z35LY select a,b,c from W10VUM5G
    );
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 May 2020 11:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-set-statements-into-sql/m-p/647751#M193894</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-05-14T11:01:05Z</dc:date>
    </item>
  </channel>
</rss>

