<?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: Cleaning up output from proc report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618892#M77070</link>
    <description>&lt;P&gt;Set the column headers in the DEFINE statements to blank for the labels you don't want.&lt;/P&gt;
&lt;P&gt;Change the order of the across and value variables in the eliminate the extra blank line.&amp;nbsp; It seems illogical to list the analysis variable before the across variables, but it does eliminate that extra blank line.&lt;/P&gt;
&lt;P&gt;Add the NOZERO option tot he define statement for VALUE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = have nowd ;
	columns order group value,year,month;
	define order 	/ noprint;
	define group	/ group ;
	define year	/ across ' ';
	define month	/ across ' ';
	define value	/ analysis ' ' nozero;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                                                     2019                                     2020

  group                         7          8          9         10         11         12          1
  group 1                      10         10         15        100        100        500       1000
  group 2                      10         10         10         12        100        250        300
  group 3                       .          .          5          5          5          7        100
  group 3 / group 2             .          .        0.5       0.42       0.05       0.03        0.3

&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 433px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35525i2C90FD5F9621B801/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 16:44:02 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-01-21T16:44:02Z</dc:date>
    <item>
      <title>Cleaning up output from proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618888#M77069</link>
      <description>&lt;P&gt;Hello, I would like to cleanup a report I am creating using proc report. I have data similar to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;	
	infile datalines dlm=',';
		input order group :$20. year month value;
datalines;
1,group 1,2019,7,10
1,group 1,2019,8,10
1,group 1,2019,9,15
1,group 1,2019,10,100
1,group 1,2019,11,100
1,group 1,2019,12,500
1,group 1,2020,1,1000
2,group 2,2019,7,10
2,group 2,2019,8,10
2,group 2,2019,9,10
2,group 2,2019,10,12
2,group 2,2019,11,100
2,group 2,2019,12,250
2,group 2,2020,1,300
3,group 3,2019,9,5
3,group 3,2019,10,5
3,group 3,2019,11,5
3,group 3,2019,12,7
3,group 3,2020,1,100
4,group 3 / group 2,2019,9,0.50
4,group 3 / group 2,2019,10,0.42
4,group 3 / group 2,2019,11,0.05
4,group 3 / group 2,2019,12,0.03
4,group 3 / group 2,2020,1,0.3
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to report by group (in order of the order variable) with month and year going across. This is what I have so far:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = have nowd;
	columns order group year,month,value;

	define order 	/ noprint;
	define group	/ group ;
	define year	/ across ;
	define month	/ across ;
	define value	/ analysis ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In my output I have five header rows&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;'year'&lt;/LI&gt;
&lt;LI&gt;year value&lt;/LI&gt;
&lt;LI&gt;'month'&lt;/LI&gt;
&lt;LI&gt;month value&lt;/LI&gt;
&lt;LI&gt;'value&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Is it possible to supress the rows that say 'year','month' and 'value (1,3 and 5)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the report is producing columns that I don't have in my data. For example the year month combination of year 2020 and month 7. Is it possible to suppress these columns that I don't have data for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I included an image to further explain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately I want to put this in excel.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618888#M77069</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2020-01-21T16:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning up output from proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618892#M77070</link>
      <description>&lt;P&gt;Set the column headers in the DEFINE statements to blank for the labels you don't want.&lt;/P&gt;
&lt;P&gt;Change the order of the across and value variables in the eliminate the extra blank line.&amp;nbsp; It seems illogical to list the analysis variable before the across variables, but it does eliminate that extra blank line.&lt;/P&gt;
&lt;P&gt;Add the NOZERO option tot he define statement for VALUE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = have nowd ;
	columns order group value,year,month;
	define order 	/ noprint;
	define group	/ group ;
	define year	/ across ' ';
	define month	/ across ' ';
	define value	/ analysis ' ' nozero;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                                                     2019                                     2020

  group                         7          8          9         10         11         12          1
  group 1                      10         10         15        100        100        500       1000
  group 2                      10         10         10         12        100        250        300
  group 3                       .          .          5          5          5          7        100
  group 3 / group 2             .          .        0.5       0.42       0.05       0.03        0.3

&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 433px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35525i2C90FD5F9621B801/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618892#M77070</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-21T16:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning up output from proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618895#M77071</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;, this did exactly what I was looking for!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Cleaning-up-output-from-proc-report/m-p/618895#M77071</guid>
      <dc:creator>supp</dc:creator>
      <dc:date>2020-01-21T16:52:36Z</dc:date>
    </item>
  </channel>
</rss>

