<?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: macro within proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63780#M13872</link>
    <description>Thanks Kevin,&lt;BR /&gt;
&lt;BR /&gt;
so you mean the macro will be executed first and then sas execute the code.&lt;BR /&gt;
&lt;BR /&gt;
but some of those parameters are coming from the joined tables, if the table are not joined first, does the macro still be able to take them in as parameter?&lt;BR /&gt;
&lt;BR /&gt;
thanks,</description>
    <pubDate>Wed, 03 Dec 2008 04:19:50 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-12-03T04:19:50Z</dc:date>
    <item>
      <title>macro within proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63778#M13870</link>
      <description>Hi guys,&lt;BR /&gt;
&lt;BR /&gt;
My question is can i call macro within a proc sql procedure?&lt;BR /&gt;
&lt;BR /&gt;
I am writing a simple proc sql procedure. the macro will take table a,b fields as parameters.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
select a,&lt;BR /&gt;
          b,&lt;BR /&gt;
          c,&lt;BR /&gt;
        &amp;amp;macro(a.sth, b.otherthing)&lt;BR /&gt;
&lt;BR /&gt;
from table a left join table b&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Wed, 03 Dec 2008 01:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63778#M13870</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-03T01:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro within proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63779#M13871</link>
      <description>Yes, you can.&lt;BR /&gt;
&lt;BR /&gt;
Remember in mind that macro is just string substitution, which always occurs before code execution.</description>
      <pubDate>Wed, 03 Dec 2008 02:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63779#M13871</guid>
      <dc:creator>KevinQin</dc:creator>
      <dc:date>2008-12-03T02:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: macro within proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63780#M13872</link>
      <description>Thanks Kevin,&lt;BR /&gt;
&lt;BR /&gt;
so you mean the macro will be executed first and then sas execute the code.&lt;BR /&gt;
&lt;BR /&gt;
but some of those parameters are coming from the joined tables, if the table are not joined first, does the macro still be able to take them in as parameter?&lt;BR /&gt;
&lt;BR /&gt;
thanks,</description>
      <pubDate>Wed, 03 Dec 2008 04:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63780#M13872</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-03T04:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: macro within proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63781#M13873</link>
      <description>If the macro variable is not initialized, then it would probably not have any value if the join hasn't been done.&lt;BR /&gt;
&lt;BR /&gt;
Macro variable just holds values that can be assigned globally in SAS session (that is, independent from data steps, SQL etc). They don't get executed. If you talk about macro execution, you probably mean %macro definitions, which probably contain macro statements maybe mixed with other SAS statements/programs.&lt;BR /&gt;
&lt;BR /&gt;
You could review the on-line documentation for SAS macro programming.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 03 Dec 2008 08:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-within-proc-sql/m-p/63781#M13873</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-12-03T08:03:50Z</dc:date>
    </item>
  </channel>
</rss>

