<?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: Replace Blanks with 0 for Analysis Variables in PROC REPORT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Replace-Blanks-with-0-for-Analysis-Variables-in-PROC-REPORT/m-p/674270#M24326</link>
    <description>&lt;P&gt;I suspect you can make a custom format that uses the regular sas formats you specify, with one wrinkle - format a missing value to a 0, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value mycom
      .=0  other=[comma8.0] ;
  value mypct
      .=0  other=[percent8.0];
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; followed by a modification of the proc report:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;proc report data=mfb_ly nowd center;
	where(not missing(mech) and not missing(diag));
	options missing='';
	column mech diag,(nationalweight nationalweight=pct);
	define mech / group 'Activity' center order=freq descending style(column)=[just=l];
	define diag / across 'Diagnosis' order=formatted;

	define nationalweight / analysis SUM 'n' format=mycom8.0;
	define pct / analysis PCTSUM format=mypct8.0 '%';

	rbreak after /summarize UL OL style(summary)={font_weight=bold};
	compute mech;
    	if _break_ = '_RBREAK_' then mech = 'Total';
	endcomp;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2020 05:08:01 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2020-08-04T05:08:01Z</dc:date>
    <item>
      <title>Replace Blanks with 0 for Analysis Variables in PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Replace-Blanks-with-0-for-Analysis-Variables-in-PROC-REPORT/m-p/674263#M24325</link>
      <description>&lt;P&gt;I am creating a cross tabulation table in PROC REPORT and have a couple of columns where there is no data for the cross tab (generated as ANALYSIS variables). As coded it currently displays blanks in these cells. I want to replace it with 0 (or 0% as appropriate). I tried OPTIONS MISSING='0', but this just places a 0, and doesn't match the formatting of all cells.&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=mfb_ly nowd center;
	where(not missing(mech) and not missing(diag));
	options missing='';
	column mech diag,(nationalweight nationalweight=pct);
	define mech / group 'Activity' center order=freq descending style(column)=[just=l];
	define diag / across 'Diagnosis' order=formatted;
	define nationalweight / analysis SUM 'n' format=comma8.0;
	define pct / analysis PCTSUM format=percent8.0 '%';
	rbreak after /summarize UL OL style(summary)={font_weight=bold};
	compute mech;
    	if _break_ = '_RBREAK_' then mech = 'Total';
	endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cross_tab.png" style="width: 665px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47905iAFF502BD55C11D41/image-size/large?v=v2&amp;amp;px=999" role="button" title="cross_tab.png" alt="cross_tab.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 04:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Replace-Blanks-with-0-for-Analysis-Variables-in-PROC-REPORT/m-p/674263#M24325</guid>
      <dc:creator>tburus</dc:creator>
      <dc:date>2020-08-04T04:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Blanks with 0 for Analysis Variables in PROC REPORT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Replace-Blanks-with-0-for-Analysis-Variables-in-PROC-REPORT/m-p/674270#M24326</link>
      <description>&lt;P&gt;I suspect you can make a custom format that uses the regular sas formats you specify, with one wrinkle - format a missing value to a 0, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value mycom
      .=0  other=[comma8.0] ;
  value mypct
      .=0  other=[percent8.0];
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; followed by a modification of the proc report:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;proc report data=mfb_ly nowd center;
	where(not missing(mech) and not missing(diag));
	options missing='';
	column mech diag,(nationalweight nationalweight=pct);
	define mech / group 'Activity' center order=freq descending style(column)=[just=l];
	define diag / across 'Diagnosis' order=formatted;

	define nationalweight / analysis SUM 'n' format=mycom8.0;
	define pct / analysis PCTSUM format=mypct8.0 '%';

	rbreak after /summarize UL OL style(summary)={font_weight=bold};
	compute mech;
    	if _break_ = '_RBREAK_' then mech = 'Total';
	endcomp;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 05:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Replace-Blanks-with-0-for-Analysis-Variables-in-PROC-REPORT/m-p/674270#M24326</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-08-04T05:08:01Z</dc:date>
    </item>
  </channel>
</rss>

