<?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: Proc sql with macro or call execute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526008#M143166</link>
    <description>&lt;P&gt;Use call execute():&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set temp end=eof;
if _n_ = 1 then call execute('proc sql;');
call execute('create table ' !! out !! ' as select a.var1,b.var2 from ' !! ds1 !! ' as a, ' !! ds2 !! ' as b where a.xxx = b.xxx;');
if eof then call execute('quit;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Jan 2019 10:23:19 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-01-10T10:23:19Z</dc:date>
    <item>
      <title>Proc sql with macro or call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526005#M143163</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one dataset where values for datasets to be merged and out dataset name mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to write proc sql repeatedly and want to achieve this task with help of call execute or macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help on same ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the dataset .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
input ds1 $ 1-4 ds2 $6-9 out $ 10-14;
datalines;
DEMO AECM AE
DEMO CMAE CM
DEMO MHCM CM
TEMP OTHR TMP 
TEMP EX12 EXR
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Jan 2019 09:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526005#M143163</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2019-01-10T09:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql with macro or call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526007#M143165</link>
      <description>&lt;P&gt;What have you tried so far? Do you want to merge without BY-statement? If not, you have to add the by-variable(s) to your temp-dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 10:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526007#M143165</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-01-10T10:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql with macro or call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526008#M143166</link>
      <description>&lt;P&gt;Use call execute():&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set temp end=eof;
if _n_ = 1 then call execute('proc sql;');
call execute('create table ' !! out !! ' as select a.var1,b.var2 from ' !! ds1 !! ' as a, ' !! ds2 !! ' as b where a.xxx = b.xxx;');
if eof then call execute('quit;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Jan 2019 10:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-with-macro-or-call-execute/m-p/526008#M143166</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-10T10:23:19Z</dc:date>
    </item>
  </channel>
</rss>

