<?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: Output Rows Even When No Value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/737988#M230127</link>
    <description>&lt;P&gt;Use the Completetypes Options and the PreloadFmt Option like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value months
	   1 = 'JAN'
	   2 = 'FEB'
	   3 = 'MAR'
	   4 = 'APR'
	   5 = 'MAY'
	   6 = 'JUN'
	   7 = 'JUL'
	   8 = 'AUG'
	   9 = 'SEP'
	   10 = 'OCT'
	   11 = 'NOV'
	   12 = 'DEC'
;
run;

data example;
input month orders;
datalines;
1 25
1 36
2 95
2 86
2 74
3 25
3 91
5 53
5 58
6 29
6 41
6 58
7 79
7 46
8 13
8 82
10 94
10 52
10 45
11 78
11 47
12 45
12 39
;
run;

proc summary data = example sum missing nway completetypes;
class month / preloadfmt;
format month months.;
var orders;
output out = bymonth (drop = _type_ _freq_) sum = ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Apr 2021 18:58:59 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-04-29T18:58:59Z</dc:date>
    <item>
      <title>Output Rows Even When No Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/737987#M230126</link>
      <description>&lt;P&gt;I am sure this question has been asked and answered, but I've been searching for hours and am obviously not using the correct terms to find the answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I make sure a row is represented in output, even if there is no value?&amp;nbsp; For example, when pulling orders by day, comparing two channels (website vs actual store).&amp;nbsp; The website will have orders for every date as it never "closes".&amp;nbsp; But, the stores will have some days missing due to closures for holiday.&amp;nbsp; I am trying to keep the output consistent between channels.&amp;nbsp; So, for example, in the store data, there would be a row for 4/4/2021 (Easter), but then the values of order or demand or whatever would all be blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, when I create my own format, I thought there was a way to output all values for that format, even if there is no data for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, in the below code, there are no data lines for April or September, but would want the output to still have a line for them:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value months
	   1 = 'JAN'
	   2 = 'FEB'
	   3 = 'MAR'
	   4 = 'APR'
	   5 = 'MAY'
	   6 = 'JUN'
	   7 = 'JUL'
	   8 = 'AUG'
	   9 = 'SEP'
	   10 = 'OCT'
	   11 = 'NOV'
	   12 = 'DEC'
;
run;

data example;
input month orders;
datalines;
1 25
1 36
2 95
2 86
2 74
3 25
3 91
5 53
5 58
6 29
6 41
6 58
7 79
7 46
8 13
8 82
10 94
10 52
10 45
11 78
11 47
12 45
12 39
;
run;

proc summary data = example sum missing nway;
class month;
format month months.;
var orders;
output out = bymonth (drop = _type_ _freq_) sum = ;
run;

proc print data = bymonth noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;TABLE class="table" aria-label="Data Set WORK.BYMONTH"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;month&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;orders&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;JAN&lt;/TD&gt;
&lt;TD class="r data"&gt;61&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;FEB&lt;/TD&gt;
&lt;TD class="r data"&gt;255&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;MAR&lt;/TD&gt;
&lt;TD class="r data"&gt;116&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;MAY&lt;/TD&gt;
&lt;TD class="r data"&gt;111&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;JUN&lt;/TD&gt;
&lt;TD class="r data"&gt;128&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;JUL&lt;/TD&gt;
&lt;TD class="r data"&gt;125&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;AUG&lt;/TD&gt;
&lt;TD class="r data"&gt;95&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;OCT&lt;/TD&gt;
&lt;TD class="r data"&gt;191&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;NOV&lt;/TD&gt;
&lt;TD class="r data"&gt;125&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;DEC&lt;/TD&gt;
&lt;TD class="r data"&gt;84&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired output:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt; border-spacing: 0.05pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" border="0" width="128" cellspacing="0" cellpadding="0" aria-label="Data Set WORK.BYMONTH"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;month&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;orders&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;JAN&lt;/TD&gt;
&lt;TD align="right"&gt;61&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;FEB&lt;/TD&gt;
&lt;TD align="right"&gt;255&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;MAR&lt;/TD&gt;
&lt;TD align="right"&gt;116&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;APR&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;MAY&lt;/TD&gt;
&lt;TD align="right"&gt;111&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;JUN&lt;/TD&gt;
&lt;TD align="right"&gt;128&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;JUL&lt;/TD&gt;
&lt;TD align="right"&gt;125&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;AUG&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;SEP&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;OCT&lt;/TD&gt;
&lt;TD align="right"&gt;191&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;NOV&lt;/TD&gt;
&lt;TD align="right"&gt;125&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;DEC&lt;/TD&gt;
&lt;TD align="right"&gt;84&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/737987#M230126</guid>
      <dc:creator>dolldata</dc:creator>
      <dc:date>2021-04-29T18:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Output Rows Even When No Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/737988#M230127</link>
      <description>&lt;P&gt;Use the Completetypes Options and the PreloadFmt Option like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value months
	   1 = 'JAN'
	   2 = 'FEB'
	   3 = 'MAR'
	   4 = 'APR'
	   5 = 'MAY'
	   6 = 'JUN'
	   7 = 'JUL'
	   8 = 'AUG'
	   9 = 'SEP'
	   10 = 'OCT'
	   11 = 'NOV'
	   12 = 'DEC'
;
run;

data example;
input month orders;
datalines;
1 25
1 36
2 95
2 86
2 74
3 25
3 91
5 53
5 58
6 29
6 41
6 58
7 79
7 46
8 13
8 82
10 94
10 52
10 45
11 78
11 47
12 45
12 39
;
run;

proc summary data = example sum missing nway completetypes;
class month / preloadfmt;
format month months.;
var orders;
output out = bymonth (drop = _type_ _freq_) sum = ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/737988#M230127</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-04-29T18:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Output Rows Even When No Value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/738051#M230161</link>
      <description>&lt;P&gt;Thank you - this is exactly what I needed for categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something similar that can be done with date?&amp;nbsp; Like I mentioned when outputting results by day, but there won't be records on holidays, but still want a line for them.&amp;nbsp; Or do I need to create a new format for the entire date range I want to see?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, THANK YOU!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 23:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-Rows-Even-When-No-Value/m-p/738051#M230161</guid>
      <dc:creator>dolldata</dc:creator>
      <dc:date>2021-04-29T23:18:15Z</dc:date>
    </item>
  </channel>
</rss>

