<?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: A character operand was found in the %EVAL function or %IF condition where a numeric operand in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793688#M254410</link>
    <description>&lt;P&gt;Please post the complete log of these steps:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out=Jobcount replace
	datafile = "C:/Jobs.xlsx"
	dbms = xlsx;
	getnames=yes;
run;

proc sql;
create table countjobs as
select Countjobs into: countjobs 
from Jobcount;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Feb 2022 08:32:12 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-02-01T08:32:12Z</dc:date>
    <item>
      <title>A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793687#M254409</link>
      <description>&lt;P&gt;Hi there, getting the below error:&lt;/P&gt;
&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &lt;BR /&gt;0 &amp;lt; &amp;amp;countjobs. &lt;BR /&gt;ERROR: Skipping to next %END statement.&lt;/P&gt;
&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &lt;BR /&gt;0 &amp;gt;= &amp;amp;countjobs. &lt;BR /&gt;ERROR: Skipping to next %END statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The file&amp;nbsp;"C:/Jobs.xlsx" contains a value '3' which is identified as numeric. I think the error has to do with the &amp;amp;countjobs variable. When I use a normal digit for example a 3 then it works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am comparing the value in the file verse the count of files in the directory in the if conditions.&lt;/P&gt;
&lt;PRE&gt;%include "C:/list.sas";
%let path_in= C:/FileCheck;
%lfiles("C:/File",txt)
%let filecount = 0;

%if %sysfunc(exist(tables))
%then %do;
proc sql;
create table filecount as
select count(name) into: filecount 
from tables;
quit;
%end;

proc import out=Jobcount replace
	datafile = "C:/Jobs.xlsx"
	dbms = xlsx;
	getnames=yes;
run;

proc sql;
create table countjobs as
select Countjobs into: countjobs 
from Jobcount;
quit;

%if &amp;amp;filecount. &amp;lt; &amp;amp;countjobs. %then %do;	
	put("less than");
%end;

%if &amp;amp;filecount. &amp;gt;= &amp;amp;countjobs. %then %do;
	put("ge");
%end;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Feb 2022 08:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793687#M254409</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2022-02-01T08:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793688#M254410</link>
      <description>&lt;P&gt;Please post the complete log of these steps:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out=Jobcount replace
	datafile = "C:/Jobs.xlsx"
	dbms = xlsx;
	getnames=yes;
run;

proc sql;
create table countjobs as
select Countjobs into: countjobs 
from Jobcount;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Feb 2022 08:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793688#M254410</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-01T08:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793694#M254415</link>
      <description>34         proc sql;&lt;BR /&gt;35         create table countjobs as&lt;BR /&gt;36         select Countjobs into: countjobs&lt;BR /&gt;37         from Jobcount;&lt;BR /&gt;WARNING: INTO clause is ignored in the CREATE TABLE statement.&lt;BR /&gt;NOTE: Compression was disabled for data set WORK.COUNTJOBS because compression overhead would increase the size of the data set.&lt;BR /&gt;NOTE: Table WORK.COUNTJOBS created, with 1 rows and 1 columns.&lt;BR /&gt;&lt;BR /&gt;38         quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;      real time           0.00 seconds&lt;BR /&gt;      cpu time            0.00 seconds</description>
      <pubDate>Tue, 01 Feb 2022 08:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793694#M254415</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2022-02-01T08:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: A character operand was found in the %EVAL function or %IF condition where a numeric operand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793698#M254419</link>
      <description>&lt;P&gt;That's why Maxim 2 is &lt;STRONG&gt;Read the Log&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;(translate that to "always read the &lt;U&gt;complete&lt;/U&gt; log from top down")&lt;/P&gt;
&lt;P&gt;Seen this?&lt;/P&gt;
&lt;PRE&gt;WARNING: INTO clause is ignored in the CREATE TABLE statement.
&lt;/PRE&gt;
&lt;P&gt;this alerts you to the fact that INTO is not working here, so the macro variable is not created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When creating macro variables with SQL, only use a SELECT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select countjobs into: countjobs
from jobcount;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also use the NOPRINT option to prevent creating print output.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 09:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/793698#M254419</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-01T09:02:52Z</dc:date>
    </item>
  </channel>
</rss>

