<?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: overlapping ranges(proc format) with proc summary procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565117#M158598</link>
    <description>&lt;P&gt;You have to specify the Mulitlabel Option in PROC FORMAT like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't looked through the rest of your code, can't say if there is anything else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value ffmt (multilabel)
2='2'
3='3'
2-3='2--3'
4='4'
2-4='2-4'
5-11='5--11';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Jun 2019 06:23:47 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-06-11T06:23:47Z</dc:date>
    <item>
      <title>overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565108#M158591</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Is it possible to use&amp;nbsp; overlapping ranges(proc format) with proc summary procedure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 05:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565108#M158591</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-06-11T05:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565114#M158595</link>
      <description>&lt;P&gt;Yes. See the small example below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
value OverLapFmt (multilabel)
low - 60   = 'Group 1'
55 - 70    = 'Group 2'
65 - high  = 'Group 3'
;
run;

proc summary data=sashelp.class sum nway;
   class height / mlf;
   var weight;
   format height OverLapFmt.;
   output out=want sum=sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565114#M158595</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-11T06:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565116#M158597</link>
      <description>&lt;P&gt;I am trying to use the example that you sent (thank you so much).&lt;/P&gt;
&lt;P&gt;What is the reason that I get an error here&lt;/P&gt;
&lt;P&gt;"ERROR: These two ranges overlap: 2&amp;lt;-3 and 2-4 (fuzz=1E-12)."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Loans;
    format date date9.;
    input CustomerID  date:date9. Sum_Loan  interest score;
cards;
1234 10Jan2019 10 2.1 4
1234 13Jan2019 20 2.2 4
1234 18Feb2019 30 1.9 3
2222 10Jan2019 40 3.5 3
3333 19Jan2019 50 3.7 2
4444 21Feb2019 60 2.9 2
5555 08Jan2019 70 8.0 2
5555 26Feb2019 80 7.0 2
;
run;


proc sort data=Loans;by CustomerID;run;
Data Loans2;
set Loans;
by CustomerID;
Retain Help 0;
if first.CustomerID then Help=Help+1;
Run;


Data Loans3;
Set Loans2;
interest1=interest;
Run;


proc format;
value ffmt
2='2'
3='3'
2-3='2--3'
4='4'
2-4='2-4'
5-11='5--11';
run;
proc summary data=Loans3  nway;
 class score  /mlf;
  format score ffmt.;
    var  sum_loan interest;
    var interest1/weight=sum_loan;
    output out=pelet(drop=_type_ _freq_)
     max(Help)=n_customers
     n(Help)=nloans 
     sum(sum_loan)=Total_sum_loans 
     mean( interest1)=wgt_mean_interest
     mean( interest)= mean_interest;
	 format n_customers: comma12.
             nloans:comma12.  
             Total_sum_loans : comma12. 
             wgt_mean_interest :comma12.2
             mean_interest :comma12.2;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565116#M158597</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-06-11T06:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565117#M158598</link>
      <description>&lt;P&gt;You have to specify the Mulitlabel Option in PROC FORMAT like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't looked through the rest of your code, can't say if there is anything else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value ffmt (multilabel)
2='2'
3='3'
2-3='2--3'
4='4'
2-4='2-4'
5-11='5--11';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565117#M158598</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-11T06:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565119#M158600</link>
      <description>&lt;P&gt;Perfect!&lt;/P&gt;
&lt;P&gt;Now it is working.&lt;/P&gt;
&lt;P&gt;The last question is how can I control the order of the categories in the output.&lt;/P&gt;
&lt;P&gt;In the output I see that the order is :&lt;/P&gt;
&lt;P&gt;2&lt;BR /&gt;2--3&lt;BR /&gt;2-4&lt;BR /&gt;3&lt;BR /&gt;4&lt;/P&gt;
&lt;P&gt;But I want that the order will be :&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;2--3&lt;/P&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;P&gt;2-4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565119#M158600</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-06-11T06:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565121#M158602</link>
      <description>&lt;P&gt;You can make force that the order of the output is like the order specified in PROC FORMAT by adding a few options. I'm building on the example I posted above to demonstrate&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
value OverLapFmt (multilabel notsorted)
55 - 70    = 'Group 2'
low - 60   = 'Group 1'
65 - high  = 'Group 3'
;
run;

proc summary data=sashelp.class sum nway;
   class height / mlf preloadfmt order=data;
   var weight;
   format height OverLapFmt.;
   output out=want sum=sum;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jun 2019 06:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565121#M158602</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-11T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: overlapping ranges(proc format) with proc summary procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565596#M158820</link>
      <description>&lt;P&gt;Controlling order of appearance with multilabel formats is not a trivial exercise.&lt;/P&gt;
&lt;P&gt;The attached program document has the SAME values in different multilabel formats and displayed using different options in proc tabulate as some examples of how the format definition and report procedure options&amp;nbsp;interact.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code includes a small data set made with call to random functions.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 15:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/overlapping-ranges-proc-format-with-proc-summary-procedure/m-p/565596#M158820</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-12T15:30:11Z</dc:date>
    </item>
  </channel>
</rss>

