<?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: Macro Variable Query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434805#M107945</link>
    <description>&lt;P&gt;After resolution of the macro variables, your second SQL will look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE TEST AS SELECT DISTINCT
Acura AS BRAND, MDX AS MODEL FROM SASHELP.CARS;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See? There are no variables Acura or MDX in sashelp.cars.&lt;/P&gt;
&lt;P&gt;Maybe you are looking for a where condition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS stop shouting at your computer. The SAS interpreter can read lowercase perfectly well, and it's more readable for humans.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2018 10:48:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-02-07T10:48:58Z</dc:date>
    <item>
      <title>Macro Variable Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434801#M107944</link>
      <description>&lt;P&gt;I expect the test dataset obtain the below result; instead it got message of variables not found in the contributing table.&amp;nbsp; Anyone can help? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test Dataset&lt;/P&gt;&lt;P&gt;BRAND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODEL&lt;/P&gt;&lt;P&gt;Acura&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MDX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;select MAKE, MODEL&lt;BR /&gt;into :BRAND, :MOD&lt;BR /&gt;from SASHELP.CARS WHERE MAKE EQ 'Acura' and MODEL EQ 'MDX';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE TEST AS SELECT DISTINCT&lt;BR /&gt;&amp;amp;BRAND AS BRAND, &amp;amp;MOD AS MODEL FROM SASHELP.CARS;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 10:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434801#M107944</guid>
      <dc:creator>scb</dc:creator>
      <dc:date>2018-02-07T10:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434805#M107945</link>
      <description>&lt;P&gt;After resolution of the macro variables, your second SQL will look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE TEST AS SELECT DISTINCT
Acura AS BRAND, MDX AS MODEL FROM SASHELP.CARS;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See? There are no variables Acura or MDX in sashelp.cars.&lt;/P&gt;
&lt;P&gt;Maybe you are looking for a where condition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS stop shouting at your computer. The SAS interpreter can read lowercase perfectly well, and it's more readable for humans.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 10:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434805#M107945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-02-07T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434812#M107948</link>
      <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s answer, there is no need to use intermediary macrovariables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    CREATE TABLE TEST AS
    SELECT MAKE AS BRAND, MODEL AS MOD
    FROM sashelp.cars
    WHERE strip(upcase(MAKE))='ACURA' AND strip(upcase(MODEL))='MDX';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2018 11:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Query/m-p/434812#M107948</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-02-07T11:27:45Z</dc:date>
    </item>
  </channel>
</rss>

