<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13200#M1868</link>
    <description>In case you are asking if we should invoke a macro with or without a trailing semi-colon:&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%macro&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;dattype=demog;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;data&amp;nbsp;type&amp;nbsp;is&amp;nbsp;&amp;amp;dattype;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%mend&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;test;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;type1&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;type2&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
It depends. A macro invocation does not require a semi-colon, but anything that can signal the end of the invocation. Thus if your macro generates a complete statement including the statement ending semi-colon, then the type 2 style invocation results in an extra semi-colon. This is often OK, though, if the extra semi-colon, in the context, can be considered as a null statement and is ignored.</description>
    <pubDate>Fri, 18 Feb 2011 18:41:57 GMT</pubDate>
    <dc:creator>chang_y_chung_hotmail_com</dc:creator>
    <dc:date>2011-02-18T18:41:57Z</dc:date>
    <item>
      <title>MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13195#M1863</link>
      <description>hello,&lt;BR /&gt;
&lt;BR /&gt;
What is the difference in ending the macro TYPE1 Vs. TYPE2.&lt;BR /&gt;
Thanks &lt;BR /&gt;
&lt;BR /&gt;
TYPE1:&lt;BR /&gt;
%macro tryit;&lt;BR /&gt;
*%let dattype=ae;&lt;BR /&gt;
%let dattype=demog;&lt;BR /&gt;
*%let dattype=meds;&lt;BR /&gt;
***********************;&lt;BR /&gt;
%put data type is &amp;amp;dattype;&lt;BR /&gt;
%mend tryit;&lt;BR /&gt;
%tryit&lt;BR /&gt;
&lt;BR /&gt;
TYPE2:&lt;BR /&gt;
%macro tryit;&lt;BR /&gt;
*%let dattype=ae;&lt;BR /&gt;
%let dattype=demog;&lt;BR /&gt;
*%let dattype=meds;&lt;BR /&gt;
***********************;&lt;BR /&gt;
%put data type is &amp;amp;dattype;&lt;BR /&gt;
%mend;&lt;BR /&gt;
%tryit;</description>
      <pubDate>Fri, 18 Feb 2011 17:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13195#M1863</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-02-18T17:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13196#M1864</link>
      <description>Syntax-wise, I think you'll need to state the macro name in TYPE2 on your %mend statement.  But other than that, invoking the macro is the same.</description>
      <pubDate>Fri, 18 Feb 2011 18:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13196#M1864</guid>
      <dc:creator>SusieQ324</dc:creator>
      <dc:date>2011-02-18T18:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13197#M1865</link>
      <description>Hi:&lt;BR /&gt;
  As the documentation says&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206958.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000206958.htm&lt;/A&gt;&lt;BR /&gt;
 -- repeating the macro name is not required, but is very useful for clarity, especially when a job might have more than 1 definition for a macro program inside.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 18 Feb 2011 18:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13197#M1865</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-18T18:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13198#M1866</link>
      <description>You don't really need the macro name in the %mend statement.  It just helps you keep track of which macro you just ended.  There is no difference between the two types.</description>
      <pubDate>Fri, 18 Feb 2011 18:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13198#M1866</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-02-18T18:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13199#M1867</link>
      <description>thanks for always helping</description>
      <pubDate>Fri, 18 Feb 2011 18:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13199#M1867</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-02-18T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13200#M1868</link>
      <description>In case you are asking if we should invoke a macro with or without a trailing semi-colon:&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%macro&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;dattype=demog;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;data&amp;nbsp;type&amp;nbsp;is&amp;nbsp;&amp;amp;dattype;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%mend&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;test;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;type1&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;type2&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;test&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
It depends. A macro invocation does not require a semi-colon, but anything that can signal the end of the invocation. Thus if your macro generates a complete statement including the statement ending semi-colon, then the type 2 style invocation results in an extra semi-colon. This is often OK, though, if the extra semi-colon, in the context, can be considered as a null statement and is ignored.</description>
      <pubDate>Fri, 18 Feb 2011 18:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MACRO/m-p/13200#M1868</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-02-18T18:41:57Z</dc:date>
    </item>
  </channel>
</rss>

