<?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: the log note that :% Discovery of character operands by EVAL or% IF functions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579087#M164340</link>
    <description>Thanks,I konw where the problem is.Your suggestion is very helpful.</description>
    <pubDate>Mon, 05 Aug 2019 09:15:25 GMT</pubDate>
    <dc:creator>HannaZhang</dc:creator>
    <dc:date>2019-08-05T09:15:25Z</dc:date>
    <item>
      <title>the log note that :% Discovery of character operands by EVAL or% IF functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579077#M164335</link>
      <description>&lt;P&gt;Hi，,all;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I&amp;nbsp; tried to write some macro statements.but they did not work and I can not find the mistakes,here are the codes.Thanks.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro T71122;

proc sort data=test2;
	by OBS;
run;
data test3;
	set test2;
	if obs=1 then delete;
run;
data test3;
	set test3;
	obs=obs-1;
run;

proc sql;
	select distinct AMTEST into: AMTESTlist separated by ":" from test3 ;
run;
quit;

%let num=1;
%do %while(%scan(&amp;amp;AMTESTlist.,&amp;amp;num.,%str(:)) NE %str());
	%let AMTESTtest=%scan(&amp;amp;AMTESTlist.,&amp;amp;num.,%str(:));
%let num=%eval(&amp;amp;num.+1);

%end;

%mend;
%T71122;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 07:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579077#M164335</guid>
      <dc:creator>HannaZhang</dc:creator>
      <dc:date>2019-08-05T07:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: the log note that :% Discovery of character operands by EVAL or% IF functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579081#M164336</link>
      <description>&lt;P&gt;Macro variables have&amp;nbsp;&lt;EM&gt;scop&lt;/EM&gt;e. If created in a macro, they are&amp;nbsp;&lt;EM&gt;local&lt;/EM&gt; to that macro and vanish as soon as the macro stops executing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify the macro loop by using the automatic macro variable sqlobs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do num = 1 %to &amp;amp;sqlobs.;
  %let AMTESTtest=%scan(&amp;amp;AMTESTlist.,&amp;amp;num.,:);
%end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have further problems, post the log by using the {i} button.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 08:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579081#M164336</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-05T08:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: the log note that :% Discovery of character operands by EVAL or% IF functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579083#M164337</link>
      <description>&lt;P&gt;The code seems fine,but there is issue with the data i.e. in AMTEST there is text as '&lt;CODE class=" language-sas"&gt;æ¦“-&lt;/CODE&gt;' &lt;/P&gt;
&lt;P&gt;the special characters concatenated to HCV and these special characters need to be removed using compress function and it will resolve the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro T71122;

data test3;
	set test.test2 (ENCODING=WLATIN1);
	if obs=1 then delete;
run;

data test3;
	set test3;
	obs=obs-1;
run;

proc sql;
	select distinct compress(AMTEST,'?æ¦“-') into: AMTESTlist separated by ":" from test3 ;
quit;

%put &amp;amp;AMTESTlist.;

%let num=1;
%do %while(%scan(&amp;amp;AMTESTlist.,&amp;amp;num.,%str(:)) NE %str());
	%let AMTESTtest=%scan(&amp;amp;AMTESTlist.,&amp;amp;num.,%str(:));
%let num=%eval(&amp;amp;num.+1);
%put &amp;amp;num;
%end;

%mend;
options mprint;
%T71122;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Aug 2019 08:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579083#M164337</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-05T08:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: the log note that :% Discovery of character operands by EVAL or% IF functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579085#M164338</link>
      <description>The only place that a hidden %EVAL might be invoked is within the comparison inside the %DO %WHILE loop.  For that comparison, try switching from %SCAN to %QSCAN.</description>
      <pubDate>Mon, 05 Aug 2019 08:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579085#M164338</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-08-05T08:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: the log note that :% Discovery of character operands by EVAL or% IF functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579087#M164340</link>
      <description>Thanks,I konw where the problem is.Your suggestion is very helpful.</description>
      <pubDate>Mon, 05 Aug 2019 09:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-log-note-that-Discovery-of-character-operands-by-EVAL-or-IF/m-p/579087#M164340</guid>
      <dc:creator>HannaZhang</dc:creator>
      <dc:date>2019-08-05T09:15:25Z</dc:date>
    </item>
  </channel>
</rss>

