<?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: Invoking a macro to name a table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491035#M128663</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225124"&gt;@Mogreenly&lt;/a&gt;&amp;nbsp;I wrote this last week and would appreciate any feedback if you have some time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a short tutorial on making a macro, based on the concept of working code though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it doesn't make sense at all that's worth knowing as well!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 23:46:50 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-29T23:46:50Z</dc:date>
    <item>
      <title>Invoking a macro to name a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491025#M128658</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a very basic question about macros. I am trying to write a simple macro to merge two datasets. My code looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro form_merge (form);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table _%form as&lt;/P&gt;&lt;P&gt;select a.%form,a.var1&lt;/P&gt;&lt;P&gt;from work.data1 as A left join work.data2 as B&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend form_merge;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%form_merge (X);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is not working. For the 'create table' line, I get the warning "Apparent invocation of macro FORM not resolved", and the error "22-322: Syntax error, expecting one of the following (, '-'..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this as just regular code (i.e., substituting X for %form), it works fine. Can someone please tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 23:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491025#M128658</guid>
      <dc:creator>Mogreenly</dc:creator>
      <dc:date>2018-08-29T23:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking a macro to name a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491026#M128659</link>
      <description>&lt;P&gt;should be&amp;nbsp;&lt;SPAN&gt;create table _&lt;STRONG&gt;&amp;amp;form&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and not&amp;nbsp;create table _%form&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And the same in&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;select a.&lt;STRONG&gt;&amp;amp;form.&lt;/STRONG&gt;,a.var1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and not&amp;nbsp;select a.%form,a.var1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 23:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491026#M128659</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-29T23:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking a macro to name a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491027#M128660</link>
      <description>&lt;P&gt;Oh dear, that's embarrassing. Thanks! (this is the first macro I've ever written)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 23:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491027#M128660</guid>
      <dc:creator>Mogreenly</dc:creator>
      <dc:date>2018-08-29T23:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking a macro to name a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491035#M128663</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225124"&gt;@Mogreenly&lt;/a&gt;&amp;nbsp;I wrote this last week and would appreciate any feedback if you have some time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a short tutorial on making a macro, based on the concept of working code though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it doesn't make sense at all that's worth knowing as well!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 23:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invoking-a-macro-to-name-a-table/m-p/491035#M128663</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-29T23:46:50Z</dc:date>
    </item>
  </channel>
</rss>

