<?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 Help with SAS Macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/985984#M379890</link>
    <description>&lt;P&gt;I set up a simple macro definition, but keep getting warning in the log. Attached are macro variables and corresponding values, SAS warning messages, and complete SAS program. I hope someone can help me solve the issue. Thanks.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="macro Screenshot .png" style="width: 447px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/114116iE2F04D41B89C6F23/image-size/large?v=v2&amp;amp;px=999" role="button" title="macro Screenshot .png" alt="macro Screenshot .png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="warning Screenshot.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/114115i2DC65E89A597CDC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="warning Screenshot.png" alt="warning Screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro cagoal;
proc sql noprint;
  select distinct trim(college) as college,
                  Global_College
		into :college1-,
		     :Global_College1-
  from caa.usf_college_sort;
  quit;

       %do i=1 %to &amp;amp;sqlobs;

	   %let college_id=%superq(college&amp;amp;i);
proc export data=caa.usf_college_sort(where=(college=%bquote("&amp;amp;college_id"))
                                      keep=college global_college cohort_yr usf_pell_6yr_actual
                                           Pell_6YR_Actual Pell_6YR_Forecast l95 u95)
            outfile="&amp;amp;path\&amp;amp;&amp;amp;Global_College&amp;amp;i.._Goals.xlsx"
			dbms=xlsx
			replace;
run;
    %end;
%mend cagoal;
%cagoal

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="tinyMceEditorxliu1_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Apr 2026 18:53:37 GMT</pubDate>
    <dc:creator>xliu1</dc:creator>
    <dc:date>2026-04-05T18:53:37Z</dc:date>
    <item>
      <title>Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/985984#M379890</link>
      <description>&lt;P&gt;I set up a simple macro definition, but keep getting warning in the log. Attached are macro variables and corresponding values, SAS warning messages, and complete SAS program. I hope someone can help me solve the issue. Thanks.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="macro Screenshot .png" style="width: 447px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/114116iE2F04D41B89C6F23/image-size/large?v=v2&amp;amp;px=999" role="button" title="macro Screenshot .png" alt="macro Screenshot .png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="warning Screenshot.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/114115i2DC65E89A597CDC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="warning Screenshot.png" alt="warning Screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro cagoal;
proc sql noprint;
  select distinct trim(college) as college,
                  Global_College
		into :college1-,
		     :Global_College1-
  from caa.usf_college_sort;
  quit;

       %do i=1 %to &amp;amp;sqlobs;

	   %let college_id=%superq(college&amp;amp;i);
proc export data=caa.usf_college_sort(where=(college=%bquote("&amp;amp;college_id"))
                                      keep=college global_college cohort_yr usf_pell_6yr_actual
                                           Pell_6YR_Actual Pell_6YR_Forecast l95 u95)
            outfile="&amp;amp;path\&amp;amp;&amp;amp;Global_College&amp;amp;i.._Goals.xlsx"
			dbms=xlsx
			replace;
run;
    %end;
%mend cagoal;
%cagoal

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="tinyMceEditorxliu1_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2026 18:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/985984#M379890</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2026-04-05T18:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986006#M379891</link>
      <description>&lt;P&gt;The warning is coming because you have a value of your macro variable College_id of "A&amp;amp;S" in this line:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;proc export data=caa.usf_college_sort(where=(college=%bquote("&amp;amp;college_id"))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure that the&amp;nbsp;&lt;STRONG&gt;picture&lt;/STRONG&gt; of the log that you show actually represents a run from the code shown. There is a bit of text in the picture that reads: " MPRINT (CAGOAL) :&amp;nbsp; &amp;nbsp;WXLX;&amp;nbsp; " just before the Run statement for the Proc Export. There is nothing that you show in the CODE that would generate any such.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So perhaps you have a timing issue of the shown log and the code executed where this picture is from a previous run OR the macro wasn't recompiled after a change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might suggest closing SAS and restarting and then running the code, possibly&amp;nbsp; with a reduced input data set to just include the A&amp;amp;S. If you still get the warning then show us the entire log, pasted into a text box just like the code was, including where the macro is compiled. The suggestion of a reduced input data set is to reduce the amount of log needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2026 23:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986006#M379891</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2026-04-05T23:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986022#M379892</link>
      <description>&lt;P&gt;WXLX is a statement that PROC EXPORT generates when you are writing data to Excel using DBMS=XLSX. This is expected.&lt;/P&gt;
&lt;P&gt;You can prevent the macro warning by resolving the macro variable in single quotes using the %TSLIT function as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=caa.usf_college_sort(where=(college=%tslit(&amp;amp;college_id))
                                      keep=college global_college cohort_yr usf_pell_6yr_actual
                                           Pell_6YR_Actual Pell_6YR_Forecast l95 u95)
            outfile="&amp;amp;path\&amp;amp;&amp;amp;Global_College&amp;amp;i.._Goals.xlsx"
			dbms=xlsx
			replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Apr 2026 13:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986022#M379892</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2026-04-06T13:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986040#M379894</link>
      <description>&lt;P&gt;Thanks. This removes warning message. I really appreciate it!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2026 16:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986040#M379894</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2026-04-06T16:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986043#M379895</link>
      <description>&lt;P&gt;This issue is that you generated this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;college="A&amp;amp;S"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But there was no S macro variable found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid the macro processor examining the values embed the strings in single quotes, not double quotes.&amp;nbsp; You can include the quotes into the value of the macro variables you generate by using the QUOTE() function in your SQL query.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro cagoal;
%local i;
proc sql noprint;
  select distinct 
         quote(trim(college),"'")
       , quote(cats("&amp;amp;path\",Global_College,"_Goals.xlsx"),"'")
  into :college1-
     , :Global_College1-
  from caa.usf_college_sort
;
quit;

%do i=1 %to &amp;amp;sqlobs;
proc export dbms=xlsx replace
  data=caa.usf_college_sort
  (
    where=(college=&amp;amp;&amp;amp;college&amp;amp;i)
    keep=college global_college cohort_yr usf_pell_6yr_actual
         Pell_6YR_Actual Pell_6YR_Forecast l95 u95
  )
  outfile=&amp;amp;&amp;amp;Global_College&amp;amp;i 
;
run;
%end;
%mend cagoal;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2026 18:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986043#M379895</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-06T18:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS Macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986053#M379899</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2026 21:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-Macros/m-p/986053#M379899</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2026-04-06T21:58:28Z</dc:date>
    </item>
  </channel>
</rss>

