<?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: Positional parameters error sas macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/264012#M269248</link>
    <description>&lt;P&gt;Hi Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let bin371='MARINA, RV PARK, CAMPGROUND';&lt;BR /&gt;%let res= %qsysfunc(dequote(%left(&amp;amp;bin371)));&lt;BR /&gt;&lt;BR /&gt;%put **&amp;amp;res.**;&lt;BR /&gt;&lt;BR /&gt;**MARINA, RV PARK, CAMPGROUND**&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find this useful, &amp;nbsp;especially when you have '%', ';' , ',' &amp;nbsp;and &amp;nbsp;'&amp;amp;' in the text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS often does automatic unquoting when you least expect it, so the single quotes let you decide when you want to unquote.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 20:51:15 GMT</pubDate>
    <dc:creator>rogerjdeangelis</dc:creator>
    <dc:date>2016-04-14T20:51:15Z</dc:date>
    <item>
      <title>Positional parameters error sas macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/263846#M269246</link>
      <description>&lt;P&gt;How to solve this problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let bin371=MARINA, RV PARK, CAMPGROUND;&lt;BR /&gt;%put %qleft(&amp;amp;bin371);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is throwing me error "Positional parameters error" .I need to use qleft to remove trailing blanks. How can i Keep this value, and same time remove the trailing blanks.?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 12:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/263846#M269246</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2016-04-14T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Positional parameters error sas macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/263863#M269247</link>
      <description>&lt;P&gt;The auto macro %qleft only accepts up to two parameters. &amp;nbsp;Look at what code your macro is creating:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%put %qleft(MARINA, RV PARK, CAMPGROUND);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You will see in the above there are three parameters as you have used commas in the string.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You could try:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;%let bin371=MARINA, RV PARK, CAMPGROUND;
%put %qleft(%quote(&amp;amp;bin371));&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;However, why bother with the above at all. &amp;nbsp;Base SAS is designed to process and manipulate data. &amp;nbsp;Macro SAS is designed to generate code. &amp;nbsp;The two are for different purposes and trying to shoe horn data processing into macro language is not a good idea. &amp;nbsp;Put your list in a dataset:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PARAM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MARINA&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;RV PARK&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And then use that dataset, far easier to code and maintain.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 13:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/263863#M269247</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-14T13:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Positional parameters error sas macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/264012#M269248</link>
      <description>&lt;P&gt;Hi Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let bin371='MARINA, RV PARK, CAMPGROUND';&lt;BR /&gt;%let res= %qsysfunc(dequote(%left(&amp;amp;bin371)));&lt;BR /&gt;&lt;BR /&gt;%put **&amp;amp;res.**;&lt;BR /&gt;&lt;BR /&gt;**MARINA, RV PARK, CAMPGROUND**&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find this useful, &amp;nbsp;especially when you have '%', ';' , ',' &amp;nbsp;and &amp;nbsp;'&amp;amp;' in the text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS often does automatic unquoting when you least expect it, so the single quotes let you decide when you want to unquote.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 20:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/264012#M269248</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-04-14T20:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Positional parameters error sas macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/264089#M269249</link>
      <description>well, it is a smaller step in one of the loops, that I was using. But this worked fine for me: %sysfunc(strip(&amp;amp;bin371));</description>
      <pubDate>Fri, 15 Apr 2016 06:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Positional-parameters-error-sas-macro/m-p/264089#M269249</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2016-04-15T06:37:00Z</dc:date>
    </item>
  </channel>
</rss>

