<?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 Want a character operand, not a numeric, but is not evaluating in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197898#M2596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE height="152" style="height: 152px; width: 788px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ELSE IF '26JUN2016'd &amp;lt; todaydate &amp;lt;= '03JUL2016'd THEN DO;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;begin_date = '26JUN2016'd;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;end_date='03JUL2016'd;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;END;%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;/*format begin_date end_date date9.;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%LET start = %sysevalf(begin_date);&lt;/P&gt;&lt;P&gt;%LET end = %sysevalf(end_date);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually want to pass the date from above, 26JUN2016 to the %start variable and 03JUL2016 to the %end variable and have been trying different %EVALs to get it to evaluate what is begin_date and what is end_date&lt;/P&gt;&lt;P&gt;The issue is that if I just plainly put in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET start = begin_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it only passes along the text "begin_date" and does not solve for the what begin_date is assigned to.&lt;/P&gt;&lt;P&gt;and if I use %EVAL, then the macro looks for a numeric whereas I actually want the date (or text) of "26JUN2016" is equal to &amp;amp;start&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 19:31:26 GMT</pubDate>
    <dc:creator>zhou_larry</dc:creator>
    <dc:date>2015-04-16T19:31:26Z</dc:date>
    <item>
      <title>Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197898#M2596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE height="152" style="height: 152px; width: 788px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ELSE IF '26JUN2016'd &amp;lt; todaydate &amp;lt;= '03JUL2016'd THEN DO;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;begin_date = '26JUN2016'd;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;end_date='03JUL2016'd;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;END;%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;/*format begin_date end_date date9.;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%LET start = %sysevalf(begin_date);&lt;/P&gt;&lt;P&gt;%LET end = %sysevalf(end_date);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually want to pass the date from above, 26JUN2016 to the %start variable and 03JUL2016 to the %end variable and have been trying different %EVALs to get it to evaluate what is begin_date and what is end_date&lt;/P&gt;&lt;P&gt;The issue is that if I just plainly put in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET start = begin_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it only passes along the text "begin_date" and does not solve for the what begin_date is assigned to.&lt;/P&gt;&lt;P&gt;and if I use %EVAL, then the macro looks for a numeric whereas I actually want the date (or text) of "26JUN2016" is equal to &amp;amp;start&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 19:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197898#M2596</guid>
      <dc:creator>zhou_larry</dc:creator>
      <dc:date>2015-04-16T19:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197899#M2597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that in a data step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so to create a macro variable in a data step you need to use call symputx to create the macro variable not a %let statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 19:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197899#M2597</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-16T19:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197900#M2598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes as Reeza says, you would need to do something like the following inside the DATA step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="152" style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;begin_date = '26JUN2016'd;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;P&gt;end_date='03JUL2016'd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symput("start",begin_date);&lt;/P&gt;&lt;P&gt;call symput("end", end_date);&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then after the DATA step, the macro variables &lt;STRONG&gt;start&lt;/STRONG&gt; and &lt;STRONG&gt;end&lt;/STRONG&gt; are available to use with the actual dates in them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 20:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197900#M2598</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2015-04-16T20:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197901#M2599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed it is. So I changed it to: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symputx("start", begin_date);&lt;/P&gt;&lt;P&gt;call symputx("end", end_date);&lt;/P&gt;&lt;P&gt;format begin_date end_date start end date9.;&lt;/P&gt;&lt;P&gt;%put &amp;amp;start;&lt;/P&gt;&lt;P&gt;%put &amp;amp;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and now it's passing through!! &lt;/P&gt;&lt;P&gt;but now the date is a SAS date, &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;so '12APR2015' = 20190 which isn't ideal. and &lt;/SPAN&gt;formatting&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; it isn't exactly working &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the next data step is something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.xx;&lt;/P&gt;&lt;P&gt;keep x, y, z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE (&amp;amp;start) &amp;lt; datepart(order_date) &amp;lt;= (&amp;amp;end);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but now because it's a SAS date, it looks at 20190 &amp;lt; datepart(order_date) which comes up blank when it runs. How do I made the order_date into a SAS format or how do I make the 20190 pass as a date9. instead of a SAS date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 20:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197901#M2599</guid>
      <dc:creator>zhou_larry</dc:creator>
      <dc:date>2015-04-16T20:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197902#M2600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually your WHERE condition should still resolve properly. &lt;/P&gt;&lt;P&gt;Your data step is incorrect the keep statement has comma's and there is no SET dataset. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 23:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197902#M2600</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-16T23:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Want a character operand, not a numeric, but is not evaluating</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197903#M2601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want the macro variables to contain values that would be valid to use in generating the logical expression &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;(&amp;amp;start &amp;lt;&amp;nbsp; XX &amp;lt; &amp;amp;end)&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;where XX is a date expression then you have two choices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Store the actual integer values that represent the start and end dates. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CALL SYMPUTX('START',put(begin_date,10.))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2) Store the value as a date literal.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;CALL SYMPUTX('START',cats("'",put(begin_date,date9.)."'d"))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also create the macro variable with DATE9 formatted date strings and then add the ""d in the where clause.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;CALL SYMPUTX('START',put(begin_date,date9.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'courier new', courier;"&gt;("&amp;amp;start"d &amp;lt; XX &amp;lt; "&amp;amp;end"d)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 12:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Want-a-character-operand-not-a-numeric-but-is-not-evaluating/m-p/197903#M2601</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-17T12:17:15Z</dc:date>
    </item>
  </channel>
</rss>

