<?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: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384881#M24799</link>
    <description>&lt;P&gt;Have a look at sashelp.vtable, the dataset contains various information about datasets available in the active sas session. The following code sets dsemtpy to 1 if the dataset is empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select (nobs=0)
      into :dsempty trimmed
         from sashelp.vtable
            where libname = 'SASHELP' and MemName = 'CLASS'
      ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Aug 2017 08:16:45 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2017-08-02T08:16:45Z</dc:date>
    <item>
      <title>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384871#M24797</link>
      <description>&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Hi All &amp;nbsp;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;The Following&amp;nbsp;code in my program gives me the weird error messages and sometime it runs without any error and most of the time ended up in log file with error .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* **************************************  MACRO to Ensure Not to print If the Dataset is empty ********************/
%macro ChkDSEmpty(Table_Name);
	/* Init check flag */
	%let dsempty=0;

	/* create empty test data set by removing all records */
	data Table_Name;
		set Table_Name;
	run;

	/* Check for empty data */
	data _null_;
		if eof then
			do;
				call symput('dsempty',1);
				put 'NOTE: EOF - no records in data!';
			end;

		stop;
		set &amp;amp;Table_Name end=eof;
	run;

%mend ChkDSEmpty;

%ChkDSEmpty(SOURCEDUPLICATE);

/******************************** 1094_SUMMARY_REPORTS - creation  ******************************/
%macro Export;
	%if &amp;amp;dsempty. %then
		%do;
			%put WARNING: Export step skipped - no output records.;
		%end;
	%else
		%do;
			/*source duplicate html creation*/
			ods html file ='/mnt/agrm-rrr/1094_sourceduplicate.html' style=sasweb;

			PROC REPORT DATA=sourceduplicate NOWD;
				COL CDNUMPOL count;
				title "B2W 1094 Source Duplicate";
				Define  CDNUMPOL   / display 'CDNUMPOL';
				Define  count   / display 'count';
			RUN;

			ods _all_ close;
			ods html close;
		%end;
%mend Export;

%Export&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;The Issue arise at %Export Section &amp;nbsp;and its not resolving ..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;I'm currently using SAS EG ver&amp;nbsp;7.12 (7.100.2.3350) (32-bit).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Looking forward your reply folks ,..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Thanks in Advance ,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Srini.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 07:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384871#M24797</guid>
      <dc:creator>srinidelite</dc:creator>
      <dc:date>2017-08-02T07:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384876#M24798</link>
      <description>&lt;P&gt;When you define dsempty in the first macro, it will be stored in the local symbol table of that macro, and not be available anywhere else.&lt;/P&gt;
&lt;P&gt;Use the %global statement to put it in the global symbol table.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 08:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384876#M24798</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-02T08:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384881#M24799</link>
      <description>&lt;P&gt;Have a look at sashelp.vtable, the dataset contains various information about datasets available in the active sas session. The following code sets dsemtpy to 1 if the dataset is empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select (nobs=0)
      into :dsempty trimmed
         from sashelp.vtable
            where libname = 'SASHELP' and MemName = 'CLASS'
      ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 08:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384881#M24799</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-08-02T08:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384884#M24800</link>
      <description>&lt;P&gt;You can simplfy that to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vtable (where=(libname="&amp;lt;your lib&amp;gt;" and memname="&amp;lt;your dataset&amp;gt;"));
  if nobs=0 then call execute('%put "No obs found";');
  else call execute(' ods html file ="/mnt/agrm-rrr/1094_sourceduplicate.html" style=sasweb;
                			proc report data=sourceduplicate nowd;
                				col cdnumpol count;
                				title "B2W 1094 Source Duplicate";
                				define  cdnumpol   / display "CDNUMPOL";
                				define  count   / display "count";
                			run;
                			ods html close;');
run;&lt;/PRE&gt;
&lt;P&gt;Or if you prefer to have the report in a macro then just:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vtable (where=(libname="&amp;lt;your lib&amp;gt;" and memname="&amp;lt;your dataset&amp;gt;"));
  call execute(ifc(nobs=0,'%put "No obs found";','%PrintFile;'));
run;&lt;/PRE&gt;
&lt;P&gt;Assuming report macro is called PrintFile.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 08:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/384884#M24800</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-02T08:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric oper</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/385970#M24876</link>
      <description>&lt;P&gt;Thank you so much .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solution resolved all of existing issues . Thanks a ton&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 11:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/385970#M24876</guid>
      <dc:creator>srinidelite</dc:creator>
      <dc:date>2017-08-07T11:00:11Z</dc:date>
    </item>
  </channel>
</rss>

