<?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: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612856#M23636</link>
    <description>&lt;P&gt;Hi ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format is actually already using multilabel, but as far as I know multilabel formats are not recognized within proc report, only means, summary, and tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT ;
		VALUE $delinq_61_ (MULTILABEL)
				  "0"  =  "      0"
				 "30"  =  "  31-60"
				 "60"  =  "  61-90"
				 "90"  =  " 91-120"
				"120"  =  "121-150"
				"150"  =  "151-180"
				"180"  =  "181-210"
				"210"  =  "211+   "
"90","120","150","180","210"  =  "Total 90+ Delinquency"
		;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My hope was to be able to sum the specific rows within proc report, rather than use tabulate&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 22:13:23 GMT</pubDate>
    <dc:creator>GBL__</dc:creator>
    <dc:date>2019-12-18T22:13:23Z</dc:date>
    <item>
      <title>PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612806#M23634</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add an additional summary row, before my "Grand Total" summary row, that sums the values of specific rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I am using and the output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=&amp;amp;client_number..&amp;amp;client_number._&amp;amp;medte._pcart style(header)=[fontfamily='Albany AMT'] style(column)=[fontfamily='Albany AMT'] ;

SYSECHO "PROC REPORT - Printing Contractual Delinquency" ;

	COLUMNS CONTRACTUAL_DELINQUENCY GROSS_BALANCE GROSS_BALANCE=GROSSBAL,(PCTSUM SUM) ;

	DEFINE CONTRACTUAL_DELINQUENCY / GROUP 'Contractual Delinquency' format=$delinq_61_. RIGHT ;
	DEFINE GROSS_BALANCE / N 'Count' style(column)=[cellwidth=.7in] format=comma9. ;
	DEFINE GROSSBAL / ' ' format=dollar18.2 ;
	DEFINE PCTSUM / 'Percent of Field' style(column)=[cellwidth=1.1in] format=percent9.2 ;
	DEFINE SUM / 'Gross Balance' style(column)=[cellwidth=1.3in] format=dollar18.2 ;

	RBREAK AFTER / SUMMARIZE style=[font_style=italic font_weight=medium] ;

	COMPUTE AFTER / style=[fontsize=3 fontfamily='Calibri' font_style=italic font_weight=bold just=c] ;
		CALL DEFINE("CONTRACTUAL_DELINQUENCY", "style", "style=[pretext='Grand Totals' textalign=right]") ;
		LINE " " ;
		LINE "Filter: No Filter Used" ;
		LINE " " ;
	ENDCOMP ;

RUN ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture Minus Title.PNG" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34939iF0A10FEABC9F9BF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture Minus Title.PNG" alt="Picture Minus Title.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am hoping to accomplish is to add a row or line above "Grand Totals" that summarizes the values from 91-120, 121-150, 181-210, and 211+ and says "90+ Totals" above Grand Totals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if I am being unclear, or if this is actually not possible.&amp;nbsp; I appreciate any feedback.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 19:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612806#M23634</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-18T19:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612854#M23635</link>
      <description>&lt;P&gt;Your code references a format &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;delinq_61_&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you share the code for that format we can show you how to create another custom format that creates the groups you want. And then use that format instead of &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;delinq_61_&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want that 90+ IN Addition to the current rows you are showing the format would be a MULTILABEL format, which are practically impossible to test without actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So provide data step code showing an example of your data by following Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 22:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612854#M23635</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-18T22:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612856#M23636</link>
      <description>&lt;P&gt;Hi ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format is actually already using multilabel, but as far as I know multilabel formats are not recognized within proc report, only means, summary, and tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT ;
		VALUE $delinq_61_ (MULTILABEL)
				  "0"  =  "      0"
				 "30"  =  "  31-60"
				 "60"  =  "  61-90"
				 "90"  =  " 91-120"
				"120"  =  "121-150"
				"150"  =  "151-180"
				"180"  =  "181-210"
				"210"  =  "211+   "
"90","120","150","180","210"  =  "Total 90+ Delinquency"
		;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My hope was to be able to sum the specific rows within proc report, rather than use tabulate&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 22:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612856#M23636</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-18T22:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612874#M23638</link>
      <description>&lt;P&gt;Example from the Proc Report documentation using a multilabel format:&lt;/P&gt;
&lt;PRE&gt;proc format;
  value agelfmt (multilabel notsorted)
     11='11'
     12='12'
     13='13'
     14='14'
     15='15'
     16='16'
     11-12='11 or 12'
     13-14='13 or 14'
     15-16='15 or 16'
     low-13='13 and below'
     14-high='14 and above' ;
run;

title "GROUP Variable with MLF Option";

proc report data=sashelp.class;

   column age ('Mean' height weight);

   define age / group mlf format=agelfmt. 'Age Group' order=data preloadfmt; 
   define height / mean format=6.2 'Height (in.)';
   define weight / mean format=6.2 'Weight (lbs.)';
run; title;&lt;/PRE&gt;
&lt;P&gt;Note the MLF option on the define for age to indicate the format is multilabel . You may need to add the NOTSORTED to the format definition to get the order as desired and/or play with the order of the value&amp;nbsp;range statements in proc format. Sorting with character values that look numeric can get pretty flaky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you used code to add a character variable created from numeric values to create your variable you might be better off using the numeric value (order is much more consistent).&lt;/P&gt;
&lt;P&gt;Your multilabel formats will also often interact with ORDER= options in the proc, so you may want to experiment with sorting and Order =.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All that is why I mentioned multilabel formats without data are hard to test.&lt;/P&gt;
&lt;P&gt;I have a demonstration program with Proc Tabulate, which I use more than Report, with multiple interactions between ORDER, PRELOADFMT and NOTSORTED (or default) with different orders of the group definitions in the Value ranges.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 23:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612874#M23638</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-18T23:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612875#M23639</link>
      <description>Hi:&lt;BR /&gt;  This paper shows several ways to add extra lines to PROC REPORT: &lt;A href="https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf&lt;/A&gt; .&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 18 Dec 2019 23:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/612875#M23639</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-12-18T23:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/613052#M23640</link>
      <description>&lt;P&gt;I do not know where I read that MLF was NOT an option for PROC REPORT, but it may have been implemented somewhat recently?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either way, thank you for pointing out that I can use it, appreciate your help!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/613052#M23640</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-19T14:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - Adding Additional Summarize Row - Summing Specific Rows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/613054#M23641</link>
      <description>&lt;P&gt;Thank you, Cynthia!&amp;nbsp; This does indeed help, great paper!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 14:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-Adding-Additional-Summarize-Row-Summing-Specific/m-p/613054#M23641</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-19T14:26:13Z</dc:date>
    </item>
  </channel>
</rss>

