<?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: This %Let definition runs fine but the %Macro definition does not run  Please help with this in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957844#M373879</link>
    <description>&lt;P&gt;It's most likely uppercase is used in the macro definition (&lt;SPAN&gt;where type="%upcase(&amp;amp;type)").&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;Check your data, look at your first sql step that works with %let statement.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Try this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro customers(type);
title "&amp;amp;type Customers";
proc sql number;
select Name, Age_Group, Type
from mc1.customers
where type="&amp;amp;type";
quit;
title;
%mend customers;


%customers(Gold);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2025 19:35:46 GMT</pubDate>
    <dc:creator>A_Kh</dc:creator>
    <dc:date>2025-01-31T19:35:46Z</dc:date>
    <item>
      <title>This %Let definition runs fine but the %Macro definition does not run  Please help with this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957841#M373877</link>
      <description>&lt;P&gt;%let type=Gold;&lt;BR /&gt;title "&amp;amp;type Customers";&lt;BR /&gt;proc sql number;&lt;BR /&gt;select Name, Age_Group, Type&lt;BR /&gt;from mc1.customers&lt;BR /&gt;where Type contains "&amp;amp;type";&lt;BR /&gt;quit;&lt;BR /&gt;title;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro customers(type);&lt;BR /&gt;title "&amp;amp;type Customers";&lt;BR /&gt;proc sql number;&lt;BR /&gt;select Name, Age_Group, Type&lt;BR /&gt;from mc1.customers&lt;BR /&gt;where type="%upcase(&amp;amp;type)";&lt;BR /&gt;quit;&lt;BR /&gt;title;&lt;BR /&gt;%mend customers;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%customers(Gold)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 19:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957841#M373877</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-01-31T19:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: This %Let definition runs fine but the %Macro definition does not run  Please help with this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957843#M373878</link>
      <description>&lt;P&gt;In the first program you are generating this WHERE clause:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where Type contains "Gold"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the second one you generate this WHERE clause instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where type = "GOLD"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So you should see different results.&amp;nbsp; The only value that satisfies the second test is GOLD which does not contain any lowercase letters and so could not contatin Gold.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 20:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957843#M373878</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-31T20:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: This %Let definition runs fine but the %Macro definition does not run  Please help with this</title>
      <link>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957844#M373879</link>
      <description>&lt;P&gt;It's most likely uppercase is used in the macro definition (&lt;SPAN&gt;where type="%upcase(&amp;amp;type)").&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;Check your data, look at your first sql step that works with %let statement.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Try this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro customers(type);
title "&amp;amp;type Customers";
proc sql number;
select Name, Age_Group, Type
from mc1.customers
where type="&amp;amp;type";
quit;
title;
%mend customers;


%customers(Gold);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 19:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/This-Let-definition-runs-fine-but-the-Macro-definition-does-not/m-p/957844#M373879</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2025-01-31T19:35:46Z</dc:date>
    </item>
  </channel>
</rss>

