<?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: keyword quote parameters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692286#M210865</link>
    <description>&lt;P&gt;You need to use a WHERE condition in the SQL select.&lt;/P&gt;
&lt;P&gt;Start by creating the necessary SQL code without macro coding, once it works, you can make it dynamic.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Oct 2020 08:15:11 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-10-17T08:15:11Z</dc:date>
    <item>
      <title>keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692120#M210773</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	%macro psql(dsname= ,x=);
	proc sql;
	select  Name ,sex, Age from &amp;amp;dsname order by &amp;amp;x;
	quit;
 %mend;

	*calling ;
	;
	%psql(dsname=sashelp.class,%str(x=sex, x=age desc));

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 13:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692120#M210773</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-10-16T13:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692130#M210777</link>
      <description>&lt;P&gt;Please try the below call&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%psql(dsname=sashelp.class,x=%nrstr(sex, age desc));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 14:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692130#M210777</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-10-16T14:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692133#M210778</link>
      <description>&lt;P&gt;Since you only need to mask the comma, the %STR function is sufficient:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%psql(dsname=sashelp.class,x=%str(sex,age desc));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 14:19:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692133#M210778</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-16T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692285#M210864</link>
      <description>I Did not get only F values its give M and F both&lt;BR /&gt;&lt;BR /&gt;%psql(dsname=sashelp.class,x=%str(sex ='F',Age desc));&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Oct 2020 07:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692285#M210864</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2020-10-17T07:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692286#M210865</link>
      <description>&lt;P&gt;You need to use a WHERE condition in the SQL select.&lt;/P&gt;
&lt;P&gt;Start by creating the necessary SQL code without macro coding, once it works, you can make it dynamic.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2020 08:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692286#M210865</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-17T08:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: keyword quote parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692310#M210880</link>
      <description>&lt;P&gt;Agreeing with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; . You can't write macros and expect them to work until you have working code without macros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, here is your code when run as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%psql(dsname=sashelp.class,x=%str(sex ='F',Age desc))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;amp;DSNAME is replaced by sashelp.class and &amp;amp;X is replaced by %str(sex='F',age desc), producing this incorrect SQL code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select  Name ,sex, Age from sashelp.class order by sex='F',Age desc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you see why this SQL code doesn't work? So first, you have to write correct SQL code without macros and without macro variables, and fix the problems in the code immediately above. Show us correct SQL code that works, without macros and without macro variables, for this situation.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2020 18:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/keyword-quote-parameters/m-p/692310#M210880</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-17T18:53:27Z</dc:date>
    </item>
  </channel>
</rss>

