<?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 Proc Report - Print all format values even where no data? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192446#M13052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm running SAS 9.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example below, no data exists where product="B".&amp;nbsp; But I'd like the proc report output to display "BRAVO, 0".&lt;/P&gt;&lt;P&gt;I know I can undertake additional data-steps to force the existence of the required observations, but I wondered if there was a solution within PROC REPORT itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value $ prodfull&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'A'='Alpha'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'B'='Bravo'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'C'='Charlie'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data demodata;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 33;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do t='A','C';&lt;/P&gt;&lt;P&gt;&amp;nbsp; sales=i; product=t; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sales=22;product="C"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc report data=work.demodata;&lt;/P&gt;&lt;P&gt;title 'How can I display zero sales for Product Bravo?';&lt;/P&gt;&lt;P&gt;column Product sales;&lt;/P&gt;&lt;P&gt;define product / group f=$prodfull. 'Product' ;&lt;/P&gt;&lt;P&gt;define sales / sum 'Sales';&lt;/P&gt;&lt;P&gt;run;title;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 11:31:56 GMT</pubDate>
    <dc:creator>RB1Kenobi</dc:creator>
    <dc:date>2015-01-22T11:31:56Z</dc:date>
    <item>
      <title>Proc Report - Print all format values even where no data?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192446#M13052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm running SAS 9.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example below, no data exists where product="B".&amp;nbsp; But I'd like the proc report output to display "BRAVO, 0".&lt;/P&gt;&lt;P&gt;I know I can undertake additional data-steps to force the existence of the required observations, but I wondered if there was a solution within PROC REPORT itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value $ prodfull&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'A'='Alpha'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'B'='Bravo'&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'C'='Charlie'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data demodata;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 33;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do t='A','C';&lt;/P&gt;&lt;P&gt;&amp;nbsp; sales=i; product=t; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sales=22;product="C"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc report data=work.demodata;&lt;/P&gt;&lt;P&gt;title 'How can I display zero sales for Product Bravo?';&lt;/P&gt;&lt;P&gt;column Product sales;&lt;/P&gt;&lt;P&gt;define product / group f=$prodfull. 'Product' ;&lt;/P&gt;&lt;P&gt;define sales / sum 'Sales';&lt;/P&gt;&lt;P&gt;run;title;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 11:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192446#M13052</guid>
      <dc:creator>RB1Kenobi</dc:creator>
      <dc:date>2015-01-22T11:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Print all format values even where no data?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192447#M13053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not as far as I know.&amp;nbsp; You could of course do a pro means with / mlf option to get the results.&amp;nbsp; Me personally I always generate the table as I want to see it in the output first, then do a proc report.&amp;nbsp; The reason is twofold, first it keeps the proc report minimal, and you have more options in datastep, secondly I need to keep the dataset so that someone else can QC it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 11:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192447#M13053</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-22T11:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Print all format values even where no data?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192448#M13054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use completerows + preloadfmt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;proc format;
&amp;nbsp; value $ prodfull
&amp;nbsp; 'A'='Alpha'
&amp;nbsp; 'B'='Bravo'
&amp;nbsp; 'C'='Charlie'
&amp;nbsp; ;
run;
 
 
data demodata;
&amp;nbsp; do i=1 to 33;
&amp;nbsp; do t='A','C';
&amp;nbsp; sales=i; product=t; output;
&amp;nbsp; sales=22;product="C"; output;
&amp;nbsp; end;
&amp;nbsp; end;
run;
 
options missing='0'; 
Proc report data=work.demodata completerows&amp;nbsp; nowd;
title 'How can I display zero sales for Product Bravo?';
column Product sales;
define product / group f=$prodfull. preloadfmt 'Product' ;
define sales / sum 'Sales';
run;title;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 12:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192448#M13054</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-22T12:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Print all format values even where no data?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192449#M13055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xia, that's really going to help keep my programs sleek.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 13:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Print-all-format-values-even-where-no-data/m-p/192449#M13055</guid>
      <dc:creator>RB1Kenobi</dc:creator>
      <dc:date>2015-01-22T13:49:41Z</dc:date>
    </item>
  </channel>
</rss>

