<?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: problem with macro! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47402#M9782</link>
    <description>You are using DATA step statements such as IF so you must invoke the macro from within a DATA step or a DATA statement must be contained within the macro.</description>
    <pubDate>Wed, 29 Apr 2009 17:30:09 GMT</pubDate>
    <dc:creator>Russ_SAS</dc:creator>
    <dc:date>2009-04-29T17:30:09Z</dc:date>
    <item>
      <title>problem with macro!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47400#M9780</link>
      <description>Thanks for the help. I used the /*    */ and I still get the same error message. Here is my code and the log error that follows. In a Macro does my if-then statement take a different format?&lt;BR /&gt;
&lt;BR /&gt;
%macro Split(varname=); &lt;BR /&gt;
/***Ever ***/&lt;BR /&gt;
if (grup=1 and f&amp;amp;varname ge 1) then &amp;amp;varname.m=1;&lt;BR /&gt;
else if (grup=1 and g&amp;amp;varname ge 1) then &amp;amp;varname.m=1;&lt;BR /&gt;
else if (grup=1 and h&amp;amp;varname ge 1) then &amp;amp;varname.m=1;&lt;BR /&gt;
 %mend;&lt;BR /&gt;
%Split(varname=mim);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ERROR MESSAGE:&lt;BR /&gt;
1420  %Split(varname=lbw);&lt;BR /&gt;
NOTE: Line generated by the invoked macro "SPLIT".&lt;BR /&gt;
1      if (grup=1 and f&amp;amp;varname ge 1) then &amp;amp;varname.m=1;&lt;BR /&gt;
       --&lt;BR /&gt;
       180&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the invoked macro "SPLIT".&lt;BR /&gt;
1                                                           else if (grup=1 and g&amp;amp;varname ge&lt;BR /&gt;
                                                            ----&lt;BR /&gt;
                                                            180&lt;BR /&gt;
1   ! 1) then &amp;amp;varname.m=1; else if (grup=1 and h&amp;amp;varname ge 1) then &amp;amp;varname.m=1;    else if&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the invoked macro "SPLIT".&lt;BR /&gt;
1      else if (grup=1 and h&amp;amp;varname ge 1) then &amp;amp;varname.m=1;    else if (grup=2 and&lt;BR /&gt;
&lt;BR /&gt;
----&lt;BR /&gt;
&lt;BR /&gt;
180&lt;BR /&gt;
1   ! d&amp;amp;varname ge 1) then &amp;amp;varname.m=1; else if (grup=2 and&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order</description>
      <pubDate>Thu, 18 Sep 2008 01:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47400#M9780</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-18T01:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem with macro!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47401#M9781</link>
      <description>Again, you are not sharing your COMPLETE SAS code that is enter entered or generated from other SAS code.  I do not see a %MEND statement, specifically.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 18 Sep 2008 02:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47401#M9781</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-18T02:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem with macro!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47402#M9782</link>
      <description>You are using DATA step statements such as IF so you must invoke the macro from within a DATA step or a DATA statement must be contained within the macro.</description>
      <pubDate>Wed, 29 Apr 2009 17:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-macro/m-p/47402#M9782</guid>
      <dc:creator>Russ_SAS</dc:creator>
      <dc:date>2009-04-29T17:30:09Z</dc:date>
    </item>
  </channel>
</rss>

