<?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 Parmbuff in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71800#M15534</link>
    <description>For the below code i'm not able to read in the value for COND&lt;BR /&gt;
the value for cond should resolve to:&lt;BR /&gt;
AND Customer_Segment in ('HOSPITAL')&lt;BR /&gt;
&lt;BR /&gt;
2.And also if i dont give this condition then the where condition should take only SG&lt;BR /&gt;
&lt;BR /&gt;
options mprint mlogic symbolgen;&lt;BR /&gt;
%macro OUTPUT/parmbuff;&lt;BR /&gt;
&lt;BR /&gt;
%let SG=%scan(%bquote(&amp;amp;syspbuff),1,%str(%(,%)));&lt;BR /&gt;
%LET cond=%scan(%bquote(&amp;amp;syspbuff),2,%str(%(,%)));&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%put SG = &amp;amp;SG;&lt;BR /&gt;
%put COND= &amp;amp;COND;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	    Create table ttt as&lt;BR /&gt;
		 select * from access&lt;BR /&gt;
         where  Sales_group = &amp;amp;sg &amp;amp;COND ;&lt;BR /&gt;
&lt;BR /&gt;
	  quit;&lt;BR /&gt;
%mend OUTPUT;&lt;BR /&gt;
&lt;BR /&gt;
%OUTPUT('05', AND Customer_Segment in ('HOSPITAL'));</description>
    <pubDate>Wed, 01 Jun 2011 18:18:29 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2011-06-01T18:18:29Z</dc:date>
    <item>
      <title>Parmbuff</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71800#M15534</link>
      <description>For the below code i'm not able to read in the value for COND&lt;BR /&gt;
the value for cond should resolve to:&lt;BR /&gt;
AND Customer_Segment in ('HOSPITAL')&lt;BR /&gt;
&lt;BR /&gt;
2.And also if i dont give this condition then the where condition should take only SG&lt;BR /&gt;
&lt;BR /&gt;
options mprint mlogic symbolgen;&lt;BR /&gt;
%macro OUTPUT/parmbuff;&lt;BR /&gt;
&lt;BR /&gt;
%let SG=%scan(%bquote(&amp;amp;syspbuff),1,%str(%(,%)));&lt;BR /&gt;
%LET cond=%scan(%bquote(&amp;amp;syspbuff),2,%str(%(,%)));&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%put SG = &amp;amp;SG;&lt;BR /&gt;
%put COND= &amp;amp;COND;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	    Create table ttt as&lt;BR /&gt;
		 select * from access&lt;BR /&gt;
         where  Sales_group = &amp;amp;sg &amp;amp;COND ;&lt;BR /&gt;
&lt;BR /&gt;
	  quit;&lt;BR /&gt;
%mend OUTPUT;&lt;BR /&gt;
&lt;BR /&gt;
%OUTPUT('05', AND Customer_Segment in ('HOSPITAL'));</description>
      <pubDate>Wed, 01 Jun 2011 18:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71800#M15534</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-06-01T18:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Parmbuff</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71801#M15535</link>
      <description>I suggest it would be much easier to use macro parameters instead of PARMBUFF:&lt;BR /&gt;
&lt;BR /&gt;
%macro OUTPUT(SG=, COND=);&lt;BR /&gt;
&lt;BR /&gt;
macro call:&lt;BR /&gt;
&lt;BR /&gt;
%OUTPUT(SG=%str('05'), COND=%str(AND Customer_Segment in ('HOSPITAL')));&lt;BR /&gt;
&lt;BR /&gt;
Then you don't need to unpack the PARMBUFF inside the macro.</description>
      <pubDate>Wed, 01 Jun 2011 21:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71801#M15535</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2011-06-01T21:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Parmbuff</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71802#M15536</link>
      <description>It is interesting.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
%macro OUTPUT/parmbuff;&lt;BR /&gt;
&lt;BR /&gt;
%let SG=%qscan(&amp;amp;syspbuff,1,%str(,%());&lt;BR /&gt;
%LET cond=%qsubstr(&amp;amp;syspbuff,&lt;BR /&gt;
                   %index(&amp;amp;syspbuff,%str(,))+1,&lt;BR /&gt;
                   %length(&amp;amp;syspbuff)- %index(&amp;amp;syspbuff,%str(,))-1);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%put SG = &amp;amp;SG;&lt;BR /&gt;
%put COND= &amp;amp;COND;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%mend OUTPUT;&lt;BR /&gt;
&lt;BR /&gt;
%OUTPUT('05', AND Customer_Segment in ('HOSPITAL')); &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 02 Jun 2011 05:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71802#M15536</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-02T05:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Parmbuff</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71803#M15537</link>
      <description>KSharp, Thanks for the help.But I'm getting the following error:&lt;BR /&gt;
NOTE: Line generated by the macro variable "SG".&lt;BR /&gt;
1     '05'&lt;BR /&gt;
      -&lt;BR /&gt;
      22&lt;BR /&gt;
SYMBOLGEN:  Macro variable COND resolves to  AND Customer_Segment in ('HOSPITAL')&lt;BR /&gt;
SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;
            unquoted for printing.&lt;BR /&gt;
NOTE: Line generated by the macro variable "SG".&lt;BR /&gt;
1     '05'&lt;BR /&gt;
      -&lt;BR /&gt;
      200&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;
              a numeric constant, a datetime constant, a missing value, (, *, +, -, ALL, ANY,&lt;BR /&gt;
              BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE, USER.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the macro variable "COND".&lt;BR /&gt;
1      AND Customer_Segment in ('HOSPITAL')&lt;BR /&gt;
                                -&lt;BR /&gt;
                                22&lt;BR /&gt;
                                 -&lt;BR /&gt;
                                 200&lt;BR /&gt;
MPRINT(OUTPUT):   Create table ttt as select * from access where Sales_group = '05' AND&lt;BR /&gt;
Customer_Segment in ('HOSPITAL');&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,&lt;BR /&gt;
              a datetime constant, a missing value, (, -, SELECT.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I tried the following and it worked:&lt;BR /&gt;
%let parms=%qsubstr(&amp;amp;syspbuff,2,%length(&amp;amp;syspbuff)-2);&lt;BR /&gt;
&lt;BR /&gt;
   %let sg=%scan(&amp;amp;parms,1,%str(,));&lt;BR /&gt;
   %let cond=%scan(&amp;amp;parms,2,%str(,));&lt;BR /&gt;
   %put parms=&amp;amp;parms.;&lt;BR /&gt;
   %put sg=&amp;amp;sg.;&lt;BR /&gt;
   %put cond=&amp;amp;cond.;</description>
      <pubDate>Thu, 02 Jun 2011 13:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Parmbuff/m-p/71803#M15537</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-06-02T13:24:00Z</dc:date>
    </item>
  </channel>
</rss>

