<?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: HELP WITH MACRO in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419807#M280517</link>
    <description>&lt;P&gt;What is so hard to understand here?&lt;/P&gt;
&lt;PRE&gt;316 %macro mycorr(&amp;amp;a=, &amp;amp;b=);
ERROR: Invalid macro parameter name &amp;amp;. It should be a valid SAS identifier no longer than 32
characters.&lt;/PRE&gt;
&lt;P&gt;valid SAS names DO NOT contain ampersands, period.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Dec 2017 13:55:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-12-09T13:55:02Z</dc:date>
    <item>
      <title>HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419804#M280515</link>
      <description>&lt;P&gt;Please help my macro code is not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the question I am being asked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Use a single macro with two parameters to assess the correlation between mean fasting glucose and age, body composition, blood pressure and lipid concentrations&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Obtain unadjusted correlations between mean fasting plasma glucose and age, weight, weight at age of 20, percent weight change, waist to hip ratio, BMI, HDL cholesterol, total cholesterol, the ratio of total to HDL cholesterol (as a continuous variable), systolic blood pressure and diastolic blood pressure.&lt;/LI&gt;&lt;LI&gt;Obtain age-adjusted correlation coefficients for the above-mentioned correlation tests (except for the correlation between mean fasting plasma glucose and age)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my macro code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mycorr(&amp;amp;a=, &amp;amp;b=);&lt;BR /&gt;proc corr data=PJ123 spearman;&lt;BR /&gt;var meanFG;&lt;BR /&gt;with &amp;amp;a;&lt;BR /&gt;only &amp;amp;b;&lt;BR /&gt;run;&lt;BR /&gt;%mend mycorr;&lt;/P&gt;&lt;P&gt;%mycorr(a=Age weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP);&lt;BR /&gt;%mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;316 %macro mycorr(&amp;amp;a=, &amp;amp;b=);&lt;BR /&gt;ERROR: Invalid macro parameter name &amp;amp;. It should be a valid SAS identifier no longer than 32&lt;BR /&gt;characters.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;BR /&gt;317 proc corr data=PJ123 spearman;&lt;BR /&gt;318 var meanFG;&lt;BR /&gt;319 with &amp;amp;a;&lt;BR /&gt;320 only &amp;amp;b;&lt;BR /&gt;321 run;&lt;BR /&gt;322 %mend mycorr;&lt;BR /&gt;323&lt;BR /&gt;324 %mycorr(a=Age weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP);&lt;BR /&gt;-&lt;BR /&gt;180&lt;BR /&gt;WARNING: Apparent invocation of macro MYCORR not resolved.&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;WARNING: Apparent invocation of macro MYCORR not resolved.&lt;BR /&gt;325 %mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);&lt;BR /&gt;-&lt;BR /&gt;180&lt;/P&gt;&lt;P&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;</description>
      <pubDate>Sat, 09 Dec 2017 13:49:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419804#M280515</guid>
      <dc:creator>eee100</dc:creator>
      <dc:date>2017-12-09T13:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419806#M280516</link>
      <description>&lt;P&gt;Start with this line instead of the one you have, see if the macro runs with that line.&lt;/P&gt;
&lt;PRE&gt;%macro mycorr(a=, b=);&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Dec 2017 13:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419806#M280516</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-09T13:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419807#M280517</link>
      <description>&lt;P&gt;What is so hard to understand here?&lt;/P&gt;
&lt;PRE&gt;316 %macro mycorr(&amp;amp;a=, &amp;amp;b=);
ERROR: Invalid macro parameter name &amp;amp;. It should be a valid SAS identifier no longer than 32
characters.&lt;/PRE&gt;
&lt;P&gt;valid SAS names DO NOT contain ampersands, period.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 13:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419807#M280517</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-09T13:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419809#M280518</link>
      <description>&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It ran with one error statement referring to the only:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro mycorr(a=, b=);&lt;BR /&gt;353 proc corr data=PJ123 spearman;&lt;BR /&gt;354 var meanFG;&lt;BR /&gt;355 with &amp;amp;a;&lt;BR /&gt;356 only &amp;amp;b;&lt;BR /&gt;357 run;&lt;BR /&gt;358 %mend mycorr;&lt;BR /&gt;359&lt;BR /&gt;360 %mycorr(a=Age weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP);&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE GLM used (Total process time):&lt;BR /&gt;real time 19:07.72&lt;BR /&gt;cpu time 8.87 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Data file WORK.PJ123.DATA is in a format that is native to another host, or the file&lt;BR /&gt;encoding does not match the session encoding. Cross Environment Data Access will be used,&lt;BR /&gt;which might require additional CPU resources and might reduce performance.&lt;BR /&gt;NOTE: Line generated by the invoked macro "MYCORR".&lt;BR /&gt;1 with &amp;amp;a; only &amp;amp;b; run;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE CORR used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;361 %mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Data file WORK.PJ123.DATA is in a format that is native to another host, or the file&lt;BR /&gt;encoding does not match the session encoding. Cross Environment Data Access will be used,&lt;BR /&gt;which might require additional CPU resources and might reduce performance.&lt;BR /&gt;NOTE: Line generated by the invoked macro "MYCORR".&lt;BR /&gt;1 with &amp;amp;a; only &amp;amp;b; run;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE CORR used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 14:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419809#M280518</guid>
      <dc:creator>eee100</dc:creator>
      <dc:date>2017-12-09T14:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419810#M280519</link>
      <description>&lt;P&gt;Where's parameter b in your macro call? You defined it, but did not supply it when calling the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 14:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419810#M280519</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-09T14:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419811#M280520</link>
      <description>&lt;P&gt;&lt;BR /&gt;361 %mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 14:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419811#M280520</guid>
      <dc:creator>eee100</dc:creator>
      <dc:date>2017-12-09T14:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: HELP WITH MACRO</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419819#M280521</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181788"&gt;@eee100&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;361 %mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which is different than your previous post. Since you did not post any error, I take it that the code works now.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2017 15:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-WITH-MACRO/m-p/419819#M280521</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-09T15:21:51Z</dc:date>
    </item>
  </channel>
</rss>

