<?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 Including 0 as a Mean for When Data is Missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668445#M200373</link>
    <description>&lt;P&gt;I am creating a dataset for an Excel pivot table with respect to revenue from airlines. There are cases where an airline has no flights for a month, and hence no revenue. I'd like there to be a forced count of 0 for the month and 0 for revenue. I have this code from proc means:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC MEANS DATA=EGTASK.REVENUE
	NOPRINT	CHARTYPE
	NOLABELS
	NWAY
	
		SUM NONOBS 	;
	VAR amount;
	CLASS name /	ORDER=UNFORMATTED ASCENDING;
	BY Year Month;

OUTPUT 	OUT=EGTASK.REVENUE_BY_CLIENT_MONTHLY
	
		SUM()=

	/ AUTONAME AUTOLABEL  WAYS INHERIT
	;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What ends up happening is that the top 6 clients (called name above) from the previous year are tracked during the current year. If there is a month where there are no observations for a client (called name) then they should be set to 0 for both flight counts and revenue totals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 19:01:37 GMT</pubDate>
    <dc:creator>BCNAV</dc:creator>
    <dc:date>2020-07-10T19:01:37Z</dc:date>
    <item>
      <title>Including 0 as a Mean for When Data is Missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668445#M200373</link>
      <description>&lt;P&gt;I am creating a dataset for an Excel pivot table with respect to revenue from airlines. There are cases where an airline has no flights for a month, and hence no revenue. I'd like there to be a forced count of 0 for the month and 0 for revenue. I have this code from proc means:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC MEANS DATA=EGTASK.REVENUE
	NOPRINT	CHARTYPE
	NOLABELS
	NWAY
	
		SUM NONOBS 	;
	VAR amount;
	CLASS name /	ORDER=UNFORMATTED ASCENDING;
	BY Year Month;

OUTPUT 	OUT=EGTASK.REVENUE_BY_CLIENT_MONTHLY
	
		SUM()=

	/ AUTONAME AUTOLABEL  WAYS INHERIT
	;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What ends up happening is that the top 6 clients (called name above) from the previous year are tracked during the current year. If there is a month where there are no observations for a client (called name) then they should be set to 0 for both flight counts and revenue totals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668445#M200373</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-10T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Including 0 as a Mean for When Data is Missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668456#M200379</link>
      <description>&lt;P&gt;If you want to use Proc Means then you will have to add the zero values into the data set if you want the mean to treat the value as 0 for means calculations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps you might want the year and month as class variables and use COMPLETETYPES on the proc statement to force values for months without any actual observations to appear in the output. Not really very clear what you actually expect.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668456#M200379</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-10T19:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Including 0 as a Mean for When Data is Missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668460#M200381</link>
      <description>You can use a CLASSDATA to indicate the levels you like to have in the report. &lt;BR /&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668460#M200381</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-10T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Including 0 as a Mean for When Data is Missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668600#M200448</link>
      <description>&lt;P&gt;CLASSDATA dataset does it!&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 19:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Including-0-as-a-Mean-for-When-Data-is-Missing/m-p/668600#M200448</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-11T19:54:21Z</dc:date>
    </item>
  </channel>
</rss>

