<?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 Run one proc sql or multiple proc sqls in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967003#M376256</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;What do you think is more efficient (run time)-&lt;/P&gt;
&lt;P&gt;Way1-- Run 2 merge in one proc sql&lt;/P&gt;
&lt;P&gt;WAY2- Run 1 merge in one proc sql and then one merge in second proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/***WAY1***/
/***WAY1***/
/***WAY1***/
proc sql;
create table WANT as
select  a.*,
		b.Branch_Cust_IP,
		b.Branch_Cust_End_Date    as _Lak_date_Close_ format=ddmmyy10.,
		b.Branch_Cust_Start_Date  as Lak_date_Open  format=ddmmyy10.,
		c.Numerator as lakoach 
from Lak_Heshbon_list as a
inner join teradata.VBM374_USED_BRANCH_CUSTOMER  as b
ON a.LAK_ID=b.Branch_Cust_Nbr and a.snif=b.Branch_Nbr
left join teradata.V01X26_MARKETING_REQ_NUMERATOR  as c
ON b.Branch_Cust_IP=c.Inv_Party_Id 
 ;
quit;


/***WAY2***/
/***WAY2***/
/***WAY2***/
proc sql;
create table ttt_a as
select  a.*,
		b.Branch_Cust_IP,
		b.Branch_Cust_End_Date    as _Lak_date_Close_ format=ddmmyy10.,
		b.Branch_Cust_Start_Date  as Lak_date_Open  format=ddmmyy10.,
		c.Numerator as lakoach
from Lak_Heshbon_list as a
inner join teradata.VBM374_USED_BRANCH_CUSTOMER  as b
ON a.LAK_ID=b.Branch_Cust_Nbr and a.snif=b.Branch_Nbr
 ;
quit;

proc sql;
create table WANT as
select a.*,b.Numerator as lakoach
from   ttt_a as a
left join teradata.V01X26_MARKETING_REQ_NUMERATOR  as b
ON a.Branch_Cust_IP=b.Inv_Party_Id 
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 May 2025 11:46:23 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2025-05-20T11:46:23Z</dc:date>
    <item>
      <title>Run one proc sql or multiple proc sqls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967003#M376256</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;What do you think is more efficient (run time)-&lt;/P&gt;
&lt;P&gt;Way1-- Run 2 merge in one proc sql&lt;/P&gt;
&lt;P&gt;WAY2- Run 1 merge in one proc sql and then one merge in second proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/***WAY1***/
/***WAY1***/
/***WAY1***/
proc sql;
create table WANT as
select  a.*,
		b.Branch_Cust_IP,
		b.Branch_Cust_End_Date    as _Lak_date_Close_ format=ddmmyy10.,
		b.Branch_Cust_Start_Date  as Lak_date_Open  format=ddmmyy10.,
		c.Numerator as lakoach 
from Lak_Heshbon_list as a
inner join teradata.VBM374_USED_BRANCH_CUSTOMER  as b
ON a.LAK_ID=b.Branch_Cust_Nbr and a.snif=b.Branch_Nbr
left join teradata.V01X26_MARKETING_REQ_NUMERATOR  as c
ON b.Branch_Cust_IP=c.Inv_Party_Id 
 ;
quit;


/***WAY2***/
/***WAY2***/
/***WAY2***/
proc sql;
create table ttt_a as
select  a.*,
		b.Branch_Cust_IP,
		b.Branch_Cust_End_Date    as _Lak_date_Close_ format=ddmmyy10.,
		b.Branch_Cust_Start_Date  as Lak_date_Open  format=ddmmyy10.,
		c.Numerator as lakoach
from Lak_Heshbon_list as a
inner join teradata.VBM374_USED_BRANCH_CUSTOMER  as b
ON a.LAK_ID=b.Branch_Cust_Nbr and a.snif=b.Branch_Nbr
 ;
quit;

proc sql;
create table WANT as
select a.*,b.Numerator as lakoach
from   ttt_a as a
left join teradata.V01X26_MARKETING_REQ_NUMERATOR  as b
ON a.Branch_Cust_IP=b.Inv_Party_Id 
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 May 2025 11:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967003#M376256</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-05-20T11:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Run one proc sql or multiple proc sqls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967004#M376257</link>
      <description>&lt;P&gt;Does not the answer from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;to use Maxim 4 apply here?&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 11:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967004#M376257</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-20T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Run one proc sql or multiple proc sqls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967014#M376259</link>
      <description>Rather than tinkering around with PROC SQL, you should try DATA step methods, e.g. hash objects if data can be fit into memory.</description>
      <pubDate>Tue, 20 May 2025 13:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967014#M376259</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-05-20T13:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Run one proc sql or multiple proc sqls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967069#M376274</link>
      <description>&lt;P&gt;Looks like you are joining a SAS table with a Teradata table. If that is the case then neither SQL example is likely to be very efficient as the whole Teradata table has to be extracted to the SAS server before it can do the join with the SAS table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 00:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967069#M376274</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-05-21T00:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Run one proc sql or multiple proc sqls</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967074#M376276</link>
      <description>For the sake of security, I would prefer to way2 .</description>
      <pubDate>Wed, 21 May 2025 01:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-one-proc-sql-or-multiple-proc-sqls/m-p/967074#M376276</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-05-21T01:43:06Z</dc:date>
    </item>
  </channel>
</rss>

