<?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: symputx question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139566#M261437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need quotation marks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where three="&amp;amp;test";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Dec 2014 05:29:46 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-12-07T05:29:46Z</dc:date>
    <item>
      <title>symputx question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139565#M261436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a very simple example that I cannot get to work and I have no idea why.&amp;nbsp; The macro variable is recognized in the put statement but not when used to pull the data in a datastep.&amp;nbsp; Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data data;&lt;BR /&gt;infile cards;&lt;BR /&gt;input one $ two $ three $;&lt;BR /&gt;cards;&lt;BR /&gt;0110 Mark 001129&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set data;&lt;BR /&gt;if one = '0110' then call symputx('test',three);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;test;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set data;&lt;BR /&gt;where three = &amp;amp;test;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;test;&lt;BR /&gt;001129&lt;BR /&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data test;&lt;BR /&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set data;&lt;BR /&gt;33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where three = &amp;amp;test;&lt;BR /&gt;ERROR: WHERE clause operator requires compatible variables.&lt;BR /&gt;34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 05:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139565#M261436</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2014-12-07T05:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: symputx question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139566#M261437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need quotation marks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where three="&amp;amp;test";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 05:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139566#M261437</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-07T05:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: symputx question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139567#M261438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your macro variable is being created properly, but you are using it to generate invalid SAS syntax.&lt;/P&gt;&lt;P&gt;You wrote &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE THREE = 001129 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS is telling you that THREE is a character variable so you cannot compare it to a number.&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In SAS literal strings need to be enclosed in quotes. So this would work:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE THREE = "001129" ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;You will need to use double quote characters so that the macro variable reference will be expanded.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE THREE = "&amp;amp;test" ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2014 06:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/symputx-question/m-p/139567#M261438</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-07T06:08:37Z</dc:date>
    </item>
  </channel>
</rss>

