<?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 ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/175991#M33746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;libname bci "/department/gld/uk/shahha03";&lt;BR /&gt;libname pdlref "/department/gld/uk/HK_MANNINGS_DC/pdl/ref/" ;&lt;BR /&gt;%macro bci_period(start_wk,end_wk);&lt;BR /&gt;data _null_;&lt;BR /&gt;set pdlref.time_cycle;&lt;BR /&gt;if week_id= &amp;amp;start_wk then do;&lt;BR /&gt; call symput("id_start",time_pd);&lt;BR /&gt; end;&lt;BR /&gt; if week_id = &amp;amp;end_wk then do;&lt;BR /&gt; call symput("id_end",time_pd);&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;id_start &amp;amp;id_end;&lt;BR /&gt;%put &amp;amp;id_start &amp;amp;id_end;&lt;BR /&gt;data _null_;&lt;BR /&gt;set pdlref.time_cycle;&lt;BR /&gt;format week_id_end yymmddn8.; &lt;BR /&gt; id_end1 = &amp;amp;id_end+1;&lt;BR /&gt; do i = &amp;amp;id_start to &amp;amp;id_end;&lt;BR /&gt; id_end1 = id_end1 -1;&lt;BR /&gt; if time_pd = id_end1 then do;&lt;BR /&gt; call symput(cat('wkno',i),week_id);&lt;BR /&gt; call symput (cat('wkedno',i),PUT(week_id_end,YYMMDDn8.));&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro bci_mnn;&lt;BR /&gt;%do i = &amp;amp;id_start %to &amp;amp;id_end;&lt;BR /&gt;%let wk=&amp;amp;&amp;amp;wkno&amp;amp;i;&lt;BR /&gt;%let wk1 =&amp;amp;&amp;amp;wkedno&amp;amp;i;&lt;BR /&gt;%put &amp;amp;wk1;&lt;BR /&gt;%let fileloc=/department/gld/uk/HK_MANNINGS_DC/rawdata/input/wk&amp;amp;&amp;amp;wk/original;&lt;BR /&gt;filename bci_mnn PIPE "zcat &amp;amp;fileloc./bci_mnn_&amp;amp;wk1.000000.dat.gz";&lt;BR /&gt;/*%let wk2 = cat('bci_mnn_',&amp;amp;wk1,'000000');*/&lt;BR /&gt;data work.bci_mnn_&amp;amp;wk (compress=yes);&lt;BR /&gt;length &lt;BR /&gt;retailer_basket_id $ 9&lt;BR /&gt;retailer_store_number $ 6 &lt;BR /&gt;retailer_loyalty_card_id $ 13&lt;BR /&gt;retailer_coupon_id $ 13&lt;BR /&gt;retailer_promotion_id $ 6 &lt;BR /&gt;time_key $ 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;member_group_code $ 17&amp;nbsp; &lt;BR /&gt;member_group_code_type $ 1 &lt;BR /&gt;coupon_printed $ 1&lt;BR /&gt;;&lt;BR /&gt;infile bci_mnn dsd missover dlm='|' end=eof;&lt;BR /&gt;/*infile "&amp;amp;fileloc./bci_mnn_&amp;amp;wk1.000000.dat" dsd missover dlm='|' end=eof;*/&lt;BR /&gt;input&lt;BR /&gt;retailer_basket_id $&lt;BR /&gt;retailer_store_number $&lt;BR /&gt;retailer_loyalty_card_id $&lt;BR /&gt;retailer_coupon_id $&lt;BR /&gt;retailer_promotion_id $&lt;BR /&gt;time_key $ &lt;BR /&gt;member_group_code $&lt;BR /&gt;member_group_code_type $&lt;BR /&gt;coupon_printed $&lt;BR /&gt;;&lt;BR /&gt;week_id = &amp;amp;wk;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table bci.BCI_MNN_&amp;amp;wk as&lt;BR /&gt;select bsk.*,cust.retailer_household_id from work.bci_mnn_&amp;amp;wk as bsk left join pdlref.customer as cust on bsk.retailer_loyalty_card_id = cust.retailer_identifying_card_id;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro bci_yyyyww;&lt;BR /&gt;%let startwk =201425;&lt;BR /&gt;%let endwk =201428;&lt;BR /&gt;%bci_period(&amp;amp;startwk,&amp;amp;endwk);&lt;BR /&gt;%bci_mnn;&lt;BR /&gt;%mend;&lt;BR /&gt;%bci_yyyyww;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID_START not resolved.&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;id_start &lt;/P&gt;&lt;P&gt;ERROR: The %FROM value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID_END not resolved.&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;id_end &lt;/P&gt;&lt;P&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;ERROR: The macro BCI_MNN will stop executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I apply macro variable inside %macro bci_period(start_wk,end_wk);&lt;/P&gt;&lt;P&gt;%bci_mnn;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program running fine and resolve this issue..can anyone says why call symput (ID_start &amp;amp; ID_end) value may not able to resolve...my question here if I created loop macro variable using call symput which is easily coming&amp;nbsp; during the program even though did not modify any syntax..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jul 2014 12:57:00 GMT</pubDate>
    <dc:creator>harshalshah</dc:creator>
    <dc:date>2014-07-11T12:57:00Z</dc:date>
    <item>
      <title>ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/175991#M33746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;libname bci "/department/gld/uk/shahha03";&lt;BR /&gt;libname pdlref "/department/gld/uk/HK_MANNINGS_DC/pdl/ref/" ;&lt;BR /&gt;%macro bci_period(start_wk,end_wk);&lt;BR /&gt;data _null_;&lt;BR /&gt;set pdlref.time_cycle;&lt;BR /&gt;if week_id= &amp;amp;start_wk then do;&lt;BR /&gt; call symput("id_start",time_pd);&lt;BR /&gt; end;&lt;BR /&gt; if week_id = &amp;amp;end_wk then do;&lt;BR /&gt; call symput("id_end",time_pd);&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;id_start &amp;amp;id_end;&lt;BR /&gt;%put &amp;amp;id_start &amp;amp;id_end;&lt;BR /&gt;data _null_;&lt;BR /&gt;set pdlref.time_cycle;&lt;BR /&gt;format week_id_end yymmddn8.; &lt;BR /&gt; id_end1 = &amp;amp;id_end+1;&lt;BR /&gt; do i = &amp;amp;id_start to &amp;amp;id_end;&lt;BR /&gt; id_end1 = id_end1 -1;&lt;BR /&gt; if time_pd = id_end1 then do;&lt;BR /&gt; call symput(cat('wkno',i),week_id);&lt;BR /&gt; call symput (cat('wkedno',i),PUT(week_id_end,YYMMDDn8.));&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro bci_mnn;&lt;BR /&gt;%do i = &amp;amp;id_start %to &amp;amp;id_end;&lt;BR /&gt;%let wk=&amp;amp;&amp;amp;wkno&amp;amp;i;&lt;BR /&gt;%let wk1 =&amp;amp;&amp;amp;wkedno&amp;amp;i;&lt;BR /&gt;%put &amp;amp;wk1;&lt;BR /&gt;%let fileloc=/department/gld/uk/HK_MANNINGS_DC/rawdata/input/wk&amp;amp;&amp;amp;wk/original;&lt;BR /&gt;filename bci_mnn PIPE "zcat &amp;amp;fileloc./bci_mnn_&amp;amp;wk1.000000.dat.gz";&lt;BR /&gt;/*%let wk2 = cat('bci_mnn_',&amp;amp;wk1,'000000');*/&lt;BR /&gt;data work.bci_mnn_&amp;amp;wk (compress=yes);&lt;BR /&gt;length &lt;BR /&gt;retailer_basket_id $ 9&lt;BR /&gt;retailer_store_number $ 6 &lt;BR /&gt;retailer_loyalty_card_id $ 13&lt;BR /&gt;retailer_coupon_id $ 13&lt;BR /&gt;retailer_promotion_id $ 6 &lt;BR /&gt;time_key $ 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;member_group_code $ 17&amp;nbsp; &lt;BR /&gt;member_group_code_type $ 1 &lt;BR /&gt;coupon_printed $ 1&lt;BR /&gt;;&lt;BR /&gt;infile bci_mnn dsd missover dlm='|' end=eof;&lt;BR /&gt;/*infile "&amp;amp;fileloc./bci_mnn_&amp;amp;wk1.000000.dat" dsd missover dlm='|' end=eof;*/&lt;BR /&gt;input&lt;BR /&gt;retailer_basket_id $&lt;BR /&gt;retailer_store_number $&lt;BR /&gt;retailer_loyalty_card_id $&lt;BR /&gt;retailer_coupon_id $&lt;BR /&gt;retailer_promotion_id $&lt;BR /&gt;time_key $ &lt;BR /&gt;member_group_code $&lt;BR /&gt;member_group_code_type $&lt;BR /&gt;coupon_printed $&lt;BR /&gt;;&lt;BR /&gt;week_id = &amp;amp;wk;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table bci.BCI_MNN_&amp;amp;wk as&lt;BR /&gt;select bsk.*,cust.retailer_household_id from work.bci_mnn_&amp;amp;wk as bsk left join pdlref.customer as cust on bsk.retailer_loyalty_card_id = cust.retailer_identifying_card_id;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro bci_yyyyww;&lt;BR /&gt;%let startwk =201425;&lt;BR /&gt;%let endwk =201428;&lt;BR /&gt;%bci_period(&amp;amp;startwk,&amp;amp;endwk);&lt;BR /&gt;%bci_mnn;&lt;BR /&gt;%mend;&lt;BR /&gt;%bci_yyyyww;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID_START not resolved.&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;id_start &lt;/P&gt;&lt;P&gt;ERROR: The %FROM value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ID_END not resolved.&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;id_end &lt;/P&gt;&lt;P&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;/P&gt;&lt;P&gt;ERROR: The macro BCI_MNN will stop executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I apply macro variable inside %macro bci_period(start_wk,end_wk);&lt;/P&gt;&lt;P&gt;%bci_mnn;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program running fine and resolve this issue..can anyone says why call symput (ID_start &amp;amp; ID_end) value may not able to resolve...my question here if I created loop macro variable using call symput which is easily coming&amp;nbsp; during the program even though did not modify any syntax..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/175991#M33746</guid>
      <dc:creator>harshalshah</dc:creator>
      <dc:date>2014-07-11T12:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/175992#M33747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest that this condition:&lt;/P&gt;&lt;P&gt;if week_id= &amp;amp;start_wk then do;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doesn't resolve at any point to be true, hence the call symput is not run and ID_START is never defined.&amp;nbsp; The likelihood is that the call:&lt;/P&gt;&lt;P&gt;%let startwk =201425;&lt;/P&gt;&lt;P&gt;%let endwk =201428;&lt;/P&gt;&lt;P&gt;%bci_period(&amp;amp;startwk,&amp;amp;endwk);&lt;/P&gt;&lt;P&gt;when looked in combination with the if statement resolves to:&lt;/P&gt;&lt;P&gt;if week_id=201425 then do; &lt;/P&gt;&lt;P&gt;Which doesn't work.&amp;nbsp; If your sure that week_id is character and contains a value for 201425, then put quotes around the macro variable and retry:&lt;/P&gt;&lt;P&gt;if week_id="&amp;amp;start_wk." then do;&amp;nbsp; &lt;/P&gt;&lt;P&gt;This should then find a row. &lt;/P&gt;&lt;P&gt;However if week_id is numeric then you may need to convert it to the numeric type of week_id, e.g.&lt;/P&gt;&lt;P&gt;if put(week_id,yymm6.) = "&amp;amp;start_wk." then do;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 13:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-A-character-operand-was-found-in-the-EVAL-function-or-IF/m-p/175992#M33747</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-11T13:13:32Z</dc:date>
    </item>
  </channel>
</rss>

