<?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: what's wrong with this macro code in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774609#M31230</link>
    <description>&lt;P&gt;oh, i missed a comma between the&amp;nbsp;%colT (data, raceeth, age) . Thank you so much.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 20:01:02 GMT</pubDate>
    <dc:creator>juliajulia</dc:creator>
    <dc:date>2021-10-15T20:01:02Z</dc:date>
    <item>
      <title>what's wrong with this macro code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774595#M31224</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can somebody help me take a look at the following macro code to see what's wrong with it. i can run the proc tabulate without macro and no error but when i put it to the macro, it give me the syntax error message:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;without macro (no error):&lt;/P&gt;
&lt;P&gt;proc tabulate data=adr.clientinfo2019 format=8.1;&lt;BR /&gt;class age race ; &lt;BR /&gt;table age='' all={label="Subtotal"}, race*(n="No." colpctn="col Percent" ) all={label="Total"} / printmiss box="";&lt;BR /&gt;format age age2fmt.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/***has error when i run the following code**/&lt;/P&gt;
&lt;P&gt;%macro colT(dset,colvar,var);&lt;BR /&gt;proc tabulate data=&amp;amp;dset. format=20.4;&lt;BR /&gt;class &amp;amp;colvar &amp;amp;var ; &lt;BR /&gt;table &amp;amp;var.="" all={label="Subtotal"}, &amp;amp;colvar*(n="No." colpctn="Col Percent") ;&lt;BR /&gt;run;&lt;BR /&gt;%mend colT;&lt;BR /&gt;%colT (data, racee age) ;&lt;/P&gt;
&lt;P&gt;error message:&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the invoked macro "COLT".&lt;BR /&gt;1 proc tabulate data=&amp;amp;dset. format=20.4; class &amp;amp;colvar &amp;amp;var ; table &amp;amp;var.=""&lt;BR /&gt;-----&lt;BR /&gt;180&lt;BR /&gt;1 ! all={label="Subtotal"}, &amp;amp;colvar*(n="No." colpctn="Col Percent") ; run;&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774595#M31224</guid>
      <dc:creator>juliajulia</dc:creator>
      <dc:date>2021-10-15T18:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this macro code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774597#M31225</link>
      <description>&lt;P&gt;Look like you might be missing a comma in the macro call.&amp;nbsp; Did you mean:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%colT (data, racee, age)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774597#M31225</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-10-15T18:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this macro code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774605#M31228</link>
      <description>&lt;P&gt;You can see more details of problems by setting Options mprint (and sometimes mlogic and symbolgen) before running the macro with problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options mprint;

%colT (data, racee age) ;

options nomprint;&lt;/PRE&gt;
&lt;P&gt;In this case if that is the code you submitted then &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt; is correct. You did not pass a value for the VAR parameter and so you would get a table statement that looks like:&lt;/P&gt;
&lt;PRE&gt;table  ="" &amp;lt;other stuff&amp;gt;&lt;/PRE&gt;
&lt;P&gt;When pasting text copied from the log you should open a text box on the forum using the &amp;lt;/&amp;gt; icon that appears above the message window and paste the copied text there. The message windows reformat text so the diagnostic characters like the underscores do not appear where they actually did in the log window.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 19:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774605#M31228</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-15T19:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this macro code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774609#M31230</link>
      <description>&lt;P&gt;oh, i missed a comma between the&amp;nbsp;%colT (data, raceeth, age) . Thank you so much.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 20:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/what-s-wrong-with-this-macro-code/m-p/774609#M31230</guid>
      <dc:creator>juliajulia</dc:creator>
      <dc:date>2021-10-15T20:01:02Z</dc:date>
    </item>
  </channel>
</rss>

