<?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: problem with resolving macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67365#M14586</link>
    <description>For this line you'd need double quotes because the SAS Macro Facility won't look inside of single-quoted strings.&lt;BR /&gt;
&lt;BR /&gt;
%bquote(')&amp;amp;return%bquote(');</description>
    <pubDate>Mon, 13 Dec 2010 16:52:32 GMT</pubDate>
    <dc:creator>PatrickG</dc:creator>
    <dc:date>2010-12-13T16:52:32Z</dc:date>
    <item>
      <title>problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67358#M14579</link>
      <description>Hi all&lt;BR /&gt;
&lt;BR /&gt;
I've got a problem with following simple program:&lt;BR /&gt;
&lt;BR /&gt;
------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;	%macro convertToWhere(string,from,to);&lt;BR /&gt;
&lt;BR /&gt;
		%let return=%str();&lt;BR /&gt;
&lt;BR /&gt;
		%do i=1 %to %length(&amp;amp;string);&lt;BR /&gt;
&lt;BR /&gt;
			%let character=%quote(%substr(&amp;amp;string,&amp;amp;i,1));&lt;BR /&gt;
&lt;BR /&gt;
				%if("&amp;amp;character" = "&amp;amp;from") %then&lt;BR /&gt;
					%let character = &amp;amp;to;&lt;BR /&gt;
&lt;BR /&gt;
			%let return=&amp;amp;return&amp;amp;character;&lt;BR /&gt;
&lt;BR /&gt;
		%end;&lt;BR /&gt;
&lt;BR /&gt;
		%bquote(')&amp;amp;return%bquote(');&lt;BR /&gt;
	&lt;BR /&gt;
	%mend;&lt;BR /&gt;
&lt;BR /&gt;
	%let list=Alfred*Alice*Barbara;&lt;BR /&gt;
&lt;BR /&gt;
	%let where=%convertToWhere(&amp;amp;list,*,' ');&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
	data _null_;&lt;BR /&gt;
&lt;BR /&gt;
		set SASHELP.CLASS;&lt;BR /&gt;
		where NAME in ( &amp;amp;where );&lt;BR /&gt;
&lt;BR /&gt;
	run;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
--------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Macro variable "where" should return text 'Alfred' 'Alice' 'Barbara' and it actually does! but I have no Idea why I get this error:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Line generated by macro variable "WHERE".&lt;BR /&gt;
1      'Alfred' 'Alice' 'Barbara'&lt;BR /&gt;
       -&lt;BR /&gt;
       22&lt;BR /&gt;
        -&lt;BR /&gt;
        76&lt;BR /&gt;
&lt;BR /&gt;
Syntax error while parsing WHERE clause.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
When I declere variable where manually &lt;BR /&gt;
&lt;B&gt;%let where= 'Alfred' 'Alice' 'Barbara';&lt;/B&gt;&lt;BR /&gt;
data step works fine.&lt;BR /&gt;
&lt;BR /&gt;
So it seems that the problem is in converting macro...have You any idea ??&lt;BR /&gt;
&lt;BR /&gt;
Thanks for help.</description>
      <pubDate>Thu, 26 Aug 2010 13:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67358#M14579</guid>
      <dc:creator>kostek</dc:creator>
      <dc:date>2010-08-26T13:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67359#M14580</link>
      <description>try %unquote() as you use the generated string</description>
      <pubDate>Thu, 26 Aug 2010 13:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67359#M14580</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-08-26T13:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67360#M14581</link>
      <description>thanks for reply&lt;BR /&gt;
&lt;BR /&gt;
do You mean:&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
	data _null_;&lt;BR /&gt;
&lt;BR /&gt;
		set SASHELP.CLASS;&lt;BR /&gt;
		where  in ( %unquote(&amp;amp;where) );&lt;BR /&gt;
&lt;BR /&gt;
	run;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
?&lt;BR /&gt;
still not working...

Message was edited by: kostek</description>
      <pubDate>Thu, 26 Aug 2010 13:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67360#M14581</guid>
      <dc:creator>kostek</dc:creator>
      <dc:date>2010-08-26T13:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67361#M14582</link>
      <description>I think it will work it you both change your single quotes to double quotes and then appy Peter's suggestion.  E.g.:&lt;BR /&gt;
&lt;BR /&gt;
%macro convertToWhere(string,from,to);&lt;BR /&gt;
&lt;BR /&gt;
%let return=%str();&lt;BR /&gt;
&lt;BR /&gt;
%do i=1 %to %length(&amp;amp;string);&lt;BR /&gt;
&lt;BR /&gt;
%let character=%quote(%substr(&amp;amp;string,&amp;amp;i,1));&lt;BR /&gt;
&lt;BR /&gt;
%if("&amp;amp;character" = "&amp;amp;from") %then&lt;BR /&gt;
%let character = &amp;amp;to;&lt;BR /&gt;
&lt;BR /&gt;
%let return=&amp;amp;return&amp;amp;character;&lt;BR /&gt;
&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
%bquote(")&amp;amp;return%bquote(");&lt;BR /&gt;
&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%let list=Alfred*Alice*Barbara;&lt;BR /&gt;
&lt;BR /&gt;
%let where=%convertToWhere(&amp;amp;list,*," ");&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set SASHELP.CLASS;&lt;BR /&gt;
  where NAME in ( %unquote(&amp;amp;where.));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Thu, 26 Aug 2010 14:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67361#M14582</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-08-26T14:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67362#M14583</link>
      <description>That's interesting it works on my SAS 9.1.3 for windows.&lt;BR /&gt;
&lt;BR /&gt;
Would you care to tell us how you intend to use this.  I ask because, I used to write similar code to do various tasks that I though I needed for processing list of words contained in macro variables.  I was all very enjoyable until I reaslize that most of that could be more effectively using tools that SAS already provides in the data step or with procs.  &lt;BR /&gt;
&lt;BR /&gt;
You could also do away with the macro that iterates over each character LIST with a rather elaborate assignment statement.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
3066  %let where = %qsysfunc(translate(%qsysfunc(tranwrd(%superQ(LIST),%str(*),%str('&lt;BR /&gt;
3066! ')),$QUOTE1024.),%str(%"),%str(%')));&lt;BR /&gt;
3067  %put NOTE: %superQ(where);&lt;BR /&gt;
NOTE: "Alfred" "Alice" "Barbara"&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
2995  %macro convertToWhere(string,from,to);&lt;BR /&gt;
2996     %let return=%str();&lt;BR /&gt;
2997     %do i=1 %to %length(&amp;amp;string);&lt;BR /&gt;
2998        %let character=%quote(%substr(&amp;amp;string,&amp;amp;i,1));&lt;BR /&gt;
2999        %if("&amp;amp;character" = "&amp;amp;from") %then&lt;BR /&gt;
3000        %let character = &amp;amp;to;&lt;BR /&gt;
3001        %let return=&amp;amp;return&amp;amp;character;&lt;BR /&gt;
3002        %end;&lt;BR /&gt;
3003     %bquote(')&amp;amp;return%bquote(');&lt;BR /&gt;
3004     %mend;&lt;BR /&gt;
3005&lt;BR /&gt;
3006  %let list=Alfred*Alice*Barbara;&lt;BR /&gt;
3007  %let where=%convertToWhere(&amp;amp;list,*,' ');&lt;BR /&gt;
3008  %put NOTE: %superQ(where);&lt;BR /&gt;
NOTE: 'Alfred' 'Alice' 'Barbara'&lt;BR /&gt;
3009&lt;BR /&gt;
3010  data _null_;&lt;BR /&gt;
3011     set SASHELP.CLASS;&lt;BR /&gt;
3012     where NAME in ( %unquote(&amp;amp;where) );&lt;BR /&gt;
3013     run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 3 observations read from the data set SASHELP.CLASS.&lt;BR /&gt;
      WHERE NAME in ('Alfred', 'Alice', 'Barbara');&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 26 Aug 2010 16:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67362#M14583</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-08-26T16:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67363#M14584</link>
      <description>Thanks Art - You're right, It works with double quotation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
data _null_; respect &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; this solution looks good for me and I agree it's sometimes better to use sas tools than write own strange progs which eventually don't work properly &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot&lt;BR /&gt;
kostek</description>
      <pubDate>Fri, 27 Aug 2010 06:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67363#M14584</guid>
      <dc:creator>kostek</dc:creator>
      <dc:date>2010-08-27T06:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67364#M14585</link>
      <description>FWIW, I was wrong!  It would have worked with either single or double quotes.&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Sat, 28 Aug 2010 13:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67364#M14585</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-08-28T13:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67365#M14586</link>
      <description>For this line you'd need double quotes because the SAS Macro Facility won't look inside of single-quoted strings.&lt;BR /&gt;
&lt;BR /&gt;
%bquote(')&amp;amp;return%bquote(');</description>
      <pubDate>Mon, 13 Dec 2010 16:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67365#M14586</guid>
      <dc:creator>PatrickG</dc:creator>
      <dc:date>2010-12-13T16:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem with resolving macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67366#M14587</link>
      <description>It is well documented that the macro quoting may confuse the tokenizer. Read the last paragraph about this happening with a %bquote()'ed quotation mark &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#tw3514-unquote.htm"&gt;here&lt;/A&gt;. Time to time, we may have to explicitly %unquote().&lt;BR /&gt;
&lt;BR /&gt;
Maybe this is one of the reasons why we have this convention of naming a macro with a "q" prefix when it returns a macro quoted string. (For instance, %qTrim(), %qSubstr(), ...)&lt;BR /&gt;
&lt;BR /&gt;
Another way to prevent this problem is just to return an unquoted string instead. For your problem, I would rather write two simple macros with more explicit names like below. HTH.&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;single&amp;nbsp;quote&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%macro&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;squote(str);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%superq&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(str)=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%return&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%local&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;s;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;s&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(%');&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%unquote&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(&amp;amp;s&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(tranwrd(&amp;amp;str,&amp;amp;s,&amp;amp;s&amp;amp;s))&amp;amp;s)&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%mend&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;squote;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;comma&amp;nbsp;separated&amp;nbsp;quoted&amp;nbsp;values&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%macro&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;csqv(list,&amp;nbsp;dlm=*);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%superq&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(list)=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%return&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%local&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;i&amp;nbsp;item;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;i&amp;nbsp;=&amp;nbsp;1;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;item&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%qscan&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(&amp;amp;list,&amp;nbsp;&amp;amp;i);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%while&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;(&amp;amp;item&amp;nbsp;^=);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;amp;i&amp;nbsp;&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#008080;font-family:Courier New;font-size:10pt;"&gt;1&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%then&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*;&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;,;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*;&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;squote&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(&amp;amp;item)&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;i&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%eval&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(&amp;amp;i&amp;nbsp;+&amp;nbsp;1);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;item&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%qscan&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(&amp;amp;list,&amp;nbsp;&amp;amp;i);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;%mend&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;csqv;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;*--&amp;nbsp;check&amp;nbsp;--*;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;print&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;=sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;name&amp;nbsp;in&amp;nbsp;(%&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;csqv&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;(Alfred*Alice*Barbara));&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;on&amp;nbsp;lst&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Sex&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Height&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Weight&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Alfred&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;69.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;112.5&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Alice&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;56.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;84.0&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Barbara&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;65.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;98.0&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2010 19:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-with-resolving-macro-variable/m-p/67366#M14587</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-12-13T19:17:13Z</dc:date>
    </item>
  </channel>
</rss>

