<?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: for help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/for-help/m-p/76236#M16471</link>
    <description>You should be using %info(&amp;amp;split)  not %info(split)</description>
    <pubDate>Tue, 20 Oct 2009 19:54:51 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-10-20T19:54:51Z</dc:date>
    <item>
      <title>for help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/for-help/m-p/76235#M16470</link>
      <description>I am trying to submit the following codes, but it always comes up with the error: ???&lt;BR /&gt;
&lt;BR /&gt;
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric &lt;BR /&gt;
       operand is required. The condition was: split-1 &lt;BR /&gt;
ERROR: The macro INFO will stop executing.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname project 'F:\Courseinfo\fall2009\CS699\presentation';&lt;BR /&gt;
&lt;BR /&gt;
%macro var_discret (var);&lt;BR /&gt;
&lt;BR /&gt;
data pd_&amp;amp;var;&lt;BR /&gt;
     set project.pd_data_import (keep=&amp;amp;var status);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=pd_&amp;amp;var;&lt;BR /&gt;
    by &amp;amp;var;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%macro info(split);&lt;BR /&gt;
 &lt;BR /&gt;
 data _null_;&lt;BR /&gt;
    %let L_obs=%sysevalf(&amp;amp;split-1);&lt;BR /&gt;
    set pd_&amp;amp;var (firstobs=1 obs=&amp;amp;L_obs) end=lastobs;&lt;BR /&gt;
	&lt;BR /&gt;
	   if status=1 then count_yes+1; &lt;BR /&gt;
	   else if status=0 then count_no+1;&lt;BR /&gt;
       if lastobs then do; p_yes=count_yes/&amp;amp;L_obs; p_no=count_no/&amp;amp;L_obs;entropy=-p_yes*log(p_yes)/log2-p_no*log(p_no)/log2;&lt;BR /&gt;
        call symput ('entropy_D1', trim(left(put(entropy,8.0)))); end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
      %let R_obs=%sysevalf(&amp;amp;split+1);&lt;BR /&gt;
    set pd_&amp;amp;var (firstobs=&amp;amp;R_obs obs=195) end=lastobs;&lt;BR /&gt;
	&lt;BR /&gt;
	   if status=1 then count_yes+1; &lt;BR /&gt;
	   else if status=0 then count_no+1;&lt;BR /&gt;
       if lastobs then do; p_yes=count_yes/(196-&amp;amp;R_obs); p_no=count_no/(196-&amp;amp;R_obs);entropy=-p_yes*log(p_yes)/log2-p_no*log(p_no)/log2;&lt;BR /&gt;
        call symput ('entropy_D2', trim(left(put(entropy,8.0)))); end;&lt;BR /&gt;
run;&lt;BR /&gt;
	  &lt;BR /&gt;
%let info=%sysevalf((&amp;amp;L_obs/195)*&amp;amp;entropy_D1+((196-&amp;amp;R_obs)/195)*&amp;amp;entropy_D2);&lt;BR /&gt;
%let previous_info=&amp;amp;info;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%do split= 2 %to 194;&lt;BR /&gt;
%info(split)&lt;BR /&gt;
%if %sysevalf(&amp;amp;info lt &amp;amp;previous_info) %then %let final_split_pos_&amp;amp;var=&amp;amp;info; &lt;BR /&gt;
%end;&lt;BR /&gt;
	 &lt;BR /&gt;
%put "The final split point for variable &amp;amp;var is &amp;amp;split";&lt;BR /&gt;
%mend;&lt;BR /&gt;
   &lt;BR /&gt;
%var_discret(MDVP_Fo)</description>
      <pubDate>Tue, 20 Oct 2009 19:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/for-help/m-p/76235#M16470</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-20T19:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: for help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/for-help/m-p/76236#M16471</link>
      <description>You should be using %info(&amp;amp;split)  not %info(split)</description>
      <pubDate>Tue, 20 Oct 2009 19:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/for-help/m-p/76236#M16471</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-10-20T19:54:51Z</dc:date>
    </item>
  </channel>
</rss>

