title: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required
body: <p>I am having errors as below.</p>
  <blockquote>
  <p>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &amp;N_GROUP</p>
  <p>ERROR: The %TO value of the %DO I loop is invalid.</p>
  <p>ERROR: The macro ORDERFLOW will stop executing.</p>
  </blockquote>
  <p>When I tested this on local without remote submitting, it worked. But it doesn't work on WRDS server. I have tried many things to fix this but cannot find out what's wrong.</p>
  <p>Here is my code. FYI, this is a pilot code for something bigger.</p>
  <pre><code>%macro orderflow(YYYYMMDD=, CUTOFF=) /des = &quot;Create OrderFlow&quot;; 
  
  %syslput YYYYMMDD = &amp;YYYYMMDD;
  %syslput CUTOFF = &amp;CUTOFF;
  
  %let wrds = wrds.wharton.upenn.edu 4016;
  options comamid=TCP;
  signon wrds username=_prompt_;
  
  rsubmit;
  
  /* Enter your WRDS institution name and your WRDS username */
  options errors=2;
  
  /* STEP 1: RETRIEVE DAILY TRADE AND QUOTE (DTAQ) FILES */
      libname nbbo '/wrds/nyse/sasdata/taqms/nbbo';
      libname cq '/wrds/nyse/sasdata/taqms/cq';
      libname ct '/wrds/nyse/sasdata/taqms/ct';
      libname mast '/wrds/nyse/sasdata/taqms/mast';
  
      /* Create StockList each having 100 stocks */
      proc sql noprint;
      select  ceil(count(SYMBOL_ROOT)/&amp;CUTOFF)    into :N_GROUP     
      from  mast.mastm_&amp;YYYYMMDD
      where  LISTED_MARKET in ('A' 'N' 'T' 'Q')   /* AMEX, NYSE, NASDAQ */
      and  TAPE = 'A'                         /* Common stock */     
      ; quit;
      
      %do i=1 %to &amp;N_GROUP;
          %global STOCKLIST&amp;i;
          proc sql noprint;
          select  SYMBOL_ROOT  into :STOCKLIST&amp;i  separated by '&quot; &quot;'
          from  mast.mastm_&amp;YYYYMMDD
          where  LISTED_MARKET in ('A' 'N' 'T' 'Q')   /* AMEX, NYSE, NASDAQ */
          and  TAPE = 'A'                             /* Common stock */
          and  monotonic() between &amp;cutoff*(&amp;i-1)+1 and &amp;cutoff*&amp;i
          ; quit;
  
  
      /* Retrieve NBBO data */
      data DailyNBBO;
  
          /* Enter NBBO file names in YYYYMMDD format for the dates you want */
          set nbbo.nbbom_&amp;YYYYMMDD;
  
          /* Enter company tickers you want */
          where sym_root in (&quot;&amp;&amp;STOCKLIST&amp;i&quot;) and 
  
          /* Quotes are retrieved prior to market open time to ensure NBBO 
             Quotes are available for beginning of the day trades */
          ((&quot;9:00:00.000000000&quot;t) &lt;= time_m &lt;= (&quot;9:30:00.000000000&quot;t));
          format date date9.;
          format time_m part_time trf_time TIME20.9;
      run;
  
      /* Retrieve Quote data */
      data DailyQuote;
  
          /* Enter Quote file names in YYYYMMDD format for the same dates */
          set cq.cqm_&amp;YYYYMMDD;
  
          /* Enter the same company tickers as above */
          where sym_root in (&quot;&amp;&amp;STOCKLIST&amp;i&quot;) and 
  
          /* Quotes are retrieved prior to market open time to ensure NBBO 
             Quotes are available for beginning of the day trades*/
          ((&quot;9:00:00.000000000&quot;t) &lt;= time_m &lt;= (&quot;9:30:00.000000000&quot;t));
          format date date9.;
          format time_m part_time trf_time TIME20.9;
      run;
  
      /* Retrieve Trade data */
      data DailyTrade;
  
          /* Enter Trade file names in YYYYMMDD format for the same dates */
          set ct.ctm_&amp;YYYYMMDD;
  
          /* Enter the same company tickers as above */
          where sym_root in (&quot;&amp;&amp;STOCKLIST&amp;i&quot;) and 
  
          /* Retrieve trades during normal market hours */
          ((&quot;9:30:00.000000000&quot;t) &lt;= time_m &lt;= (&quot;9:30:00.000000000&quot;t));
          type='T';
          format date date9.;
          format time_m part_time trf_time TIME20.9;
      run;
  
      /* Download to PC */
      proc download data=DailyNBBO out=taq.DailyNBBO_&amp;&amp;YYYYMMDD&amp;i;     run;
      proc download data=DailyQuote out=taq.DailyQuote_&amp;&amp;YYYYMMDD&amp;i;     run;
      proc download data=DailyTrade out=taq.DailyTrade_&amp;&amp;YYYYMMDD&amp;i;     run;
  
  %end;
  %mend orderflow;
  %orderflow(YYYYMMDD=20141224,CUTOFF=100);
  </code></pre>
  <p>Any comments appreciated. Thanks.</p>