<?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: proc report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report/m-p/64741#M7547</link>
    <description>Hi:&lt;BR /&gt;
  I cannot think of any situation where &lt;I&gt;varname.sum&lt;/I&gt; would be a character value, as you indicate by '0' in your comparison.&lt;BR /&gt;
[pre]&lt;BR /&gt;
if _freq_p.sum='0' then change='100';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                           &lt;BR /&gt;
I suspect that your IF test is failing. _FREQ_P should be a numeric, analysis variable if you are getting a SUM statistic for it. Therefore, there is a difference between 0 (the number) and '0' (a text character that happens to be 0). You might as well code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if _freq_p.sum='Z' then change='100';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                               &lt;BR /&gt;
Also, if you expect CHANGE to be a numeric variable, then I would expect the change='100' to be causing some automatic conversion messages. If you want CHANGE to be a character variable, then you would have to alter your COMPUTE block to:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Compute change / character length=5;&lt;BR /&gt;
. . . more code . . .&lt;BR /&gt;
Endcomp;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                        &lt;BR /&gt;
The DIVIDE function allows you to divide and if the denominator is 0, the DIVIDE function was invented so you would not get the divide by zero error messages.&lt;BR /&gt;
 &lt;BR /&gt;
I suspect that just a little more cleanup will have your program working.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 11 May 2011 14:25:41 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-05-11T14:25:41Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report/m-p/64740#M7546</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Currently I need to calculate the change to the report by using a current count and previous count. My concern is if the prior count is ‘0’ then we can’t divide it, in that case I would like to give a condition if prior count is zero then the change should be appear as ‘100’ in the report.&lt;BR /&gt;
I applied condition to the code as below,&lt;BR /&gt;
&lt;BR /&gt;
Compute change;&lt;BR /&gt;
if _freq_p.sum='0' then change='100';&lt;BR /&gt;
	   else&lt;BR /&gt;
		change=(_freq_.sum -_freq_p.sum)/_freq_p.sum;&lt;BR /&gt;
Endcomp;&lt;BR /&gt;
&lt;BR /&gt;
But I am not getting any result, what am looking for..&lt;BR /&gt;
&lt;BR /&gt;
Please let me know the mistakes that I have done ..&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;Original code&lt;/U&gt;&lt;/B&gt;&lt;BR /&gt;
Proc report data=rpt1_compare ls=256 headline headskip split='*' nowd;			&lt;BR /&gt;
	Column _freq_ _freq_p change change5;&lt;BR /&gt;
	 &lt;BR /&gt;
Define _freq_/sum "CURRENT COUNT &amp;amp;date" width=20format=comma10. Spacing=1;&lt;BR /&gt;
Define _freq_p/sum "PRIOR COUNT &amp;amp;date_p" width=20format=comma10. Spacing=1;&lt;BR /&gt;
Define change/computed 'CHANGE %' width=12 format=percent8.2 spacing=1;&lt;BR /&gt;
&lt;BR /&gt;
Compute change;&lt;BR /&gt;
Change= (_freq_.sum -_freq_p.sum)/_freq_p.sum;			&lt;BR /&gt;
Endcomp;&lt;BR /&gt;
&lt;BR /&gt;
Define change5/display 'SIGNIFICANT CHANGE &amp;gt;= 5%' width=20 format=$1. Spacing=1;&lt;BR /&gt;
	&lt;BR /&gt;
run;&lt;BR /&gt;
\&lt;BR /&gt;
Thanks in Advance</description>
      <pubDate>Wed, 11 May 2011 13:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report/m-p/64740#M7546</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-05-11T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report/m-p/64741#M7547</link>
      <description>Hi:&lt;BR /&gt;
  I cannot think of any situation where &lt;I&gt;varname.sum&lt;/I&gt; would be a character value, as you indicate by '0' in your comparison.&lt;BR /&gt;
[pre]&lt;BR /&gt;
if _freq_p.sum='0' then change='100';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                           &lt;BR /&gt;
I suspect that your IF test is failing. _FREQ_P should be a numeric, analysis variable if you are getting a SUM statistic for it. Therefore, there is a difference between 0 (the number) and '0' (a text character that happens to be 0). You might as well code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if _freq_p.sum='Z' then change='100';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                               &lt;BR /&gt;
Also, if you expect CHANGE to be a numeric variable, then I would expect the change='100' to be causing some automatic conversion messages. If you want CHANGE to be a character variable, then you would have to alter your COMPUTE block to:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Compute change / character length=5;&lt;BR /&gt;
. . . more code . . .&lt;BR /&gt;
Endcomp;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                        &lt;BR /&gt;
The DIVIDE function allows you to divide and if the denominator is 0, the DIVIDE function was invented so you would not get the divide by zero error messages.&lt;BR /&gt;
 &lt;BR /&gt;
I suspect that just a little more cleanup will have your program working.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 11 May 2011 14:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/proc-report/m-p/64741#M7547</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-05-11T14:25:41Z</dc:date>
    </item>
  </channel>
</rss>

