<?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 sql summary table-order of categories in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774174#M246012</link>
    <description>&lt;P&gt;TABULATE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
format age agefmt.;
class age;
tables age,(n pctn);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Oct 2021 10:48:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-10-14T10:48:58Z</dc:date>
    <item>
      <title>proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774127#M245983</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want that the order of categories in desired output will be in same order as in proc format.&lt;/P&gt;
&lt;P&gt;what is the way to do it please by using proc sql code as below?&lt;/P&gt;
&lt;P&gt;One solution is to write proc format with (a) (b) (c) (d) and so on&amp;nbsp; but it doesnt look&amp;nbsp; nice in output&lt;/P&gt;
&lt;PRE&gt;proc format;
value agefmt
low-18='(a) TILL 18'
18-19='(b) 18-19'
19-21='(c) 19-21'
21-high='(d) 21+'
;
Run;&lt;/PRE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input ID age;
cards;
1 15
2 17
3 18
4 21
5 22
6 19
7 19
8 31
9 39
10 48
11 54
12 17
13 18
;
Run;


proc format;
value agefmt
low-18='TILL 18'
18-19='18-19'
19-21='19-21'
21-high='21+'
;
Run;
title;
PROC SQL;
	select put(age,agefmt.) as age ,
          count(*) as nr  ,
          calculated nr/(select count(*) as  total_nr from  have)*100 as pctN 
	from  have
	group by  calculated age 
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 08:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774127#M245983</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-14T08:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774130#M245985</link>
      <description>&lt;P&gt;Use PROC FREQ with your format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
format age agefmt.;
tables age;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 07:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774130#M245985</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-14T07:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774133#M245987</link>
      <description>&lt;P&gt;And to get your dataset, add the NOCUM and OUT= options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
format age agefmt.;
tables age / nocum out=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 08:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774133#M245987</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-14T08:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774136#M245990</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's true that PROC FREQ would be more suitable for this particular example, but let's assume that your real task calls for PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a suitable ORDER BY clause you can specify virtually every conceivable sort order of records in PROC SQL. For example, insert this between the GROUP BY clause and the semicolon:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;order by age net 'T', 1&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means: The output records are first sorted by the Boolean value (cf.&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/p020urejdmvi7vn1t9avbvazqapu.htm#p0imb2dwxdypycn12cqnz9bjfx1u" target="_blank" rel="noopener"&gt;Operators&lt;/A&gt; in PROC SQL expressions)&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;1&lt;/STRONG&gt; if age does not start with "T"
&lt;STRONG&gt;0&lt;/STRONG&gt; otherwise&lt;/PRE&gt;
&lt;P&gt;(i.e., "&lt;STRONG&gt;T&lt;/STRONG&gt;ILL 18" is in group &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;, the other age categories are in group &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;-- so "TILL 18" will be the first category in the output)&lt;/P&gt;
&lt;P&gt;and, within these groups, records are sorted by the first item in the SELECT statement, i.e., by (&lt;FONT face="courier new,courier"&gt;calculated&lt;/FONT&gt;)&amp;nbsp;&lt;FONT face="courier new,courier"&gt;age&lt;/FONT&gt; itself. This ensures the correct sort order of "18-19", "19-21" and "21+" because alphabetical order is appropriate for them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 08:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774136#M245990</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-10-14T08:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774137#M245991</link>
      <description>&lt;P&gt;Thanks!!&lt;/P&gt;
&lt;P&gt;Your solution is perfect&lt;/P&gt;
&lt;P&gt;May you explain please&amp;nbsp; what does it mean&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;order by age net 'T', 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

Data have;
input ID age;
cards;
1 15
2 17
3 18
4 21
5 22
6 19
7 19
8 31
9 39
10 48
11 54
12 17
13 18
;
Run;

proc format;
value agefmt
low-18='TILL 18'
18-19='18-19'
19-21='19-21'
21-high='21+'
;
Run;
title;
PROC SQL;
	select put(age,agefmt.) as age ,
          count(*) as nr  ,
          calculated nr/(select count(*) as  total_nr from  have)*100 as pctN 
	from  have
	group by  calculated age 
		order by age net 'T', 1
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 08:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774137#M245991</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-14T08:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774138#M245992</link>
      <description>May you also show how to do it via proc tabulate and proc report and proc summary(calculate count and PCT from total and keep the order of categories as in the order in proc format)?</description>
      <pubDate>Thu, 14 Oct 2021 08:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774138#M245992</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-14T08:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774139#M245993</link>
      <description>What does it mean "net"  ?  Is it like "ne" (not)?</description>
      <pubDate>Thu, 14 Oct 2021 09:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774139#M245993</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-14T09:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774165#M246006</link>
      <description>&lt;P&gt;The NET operator is one of several operators available in PROC SQL for comparison of truncated strings, see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/p020urejdmvi7vn1t9avbvazqapu.htm#n0tcl9lmusfteon1entll2ua55r1" target="_blank" rel="noopener"&gt;Truncated String Comparison Operators&lt;/A&gt;. Two strings are considered "&lt;U&gt;n&lt;/U&gt;ot &lt;U&gt;e&lt;/U&gt;qual &lt;U&gt;t&lt;/U&gt;runcated" (so to speak) if the shorter of the two does &lt;EM&gt;not equal&lt;/EM&gt; the longer string, &lt;EM&gt;truncated&lt;/EM&gt; to the length of the shorter string. For example, &lt;FONT face="courier new,courier"&gt;"&lt;STRONG&gt;ab&lt;FONT color="#FF0000"&gt;c&lt;/FONT&gt;&lt;/STRONG&gt;" net "&lt;STRONG&gt;ab&lt;FONT color="#FF0000"&gt;d&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/FONT&gt;&amp;nbsp;and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"&lt;STRONG&gt;a&lt;FONT color="#FF0000"&gt;b&lt;/FONT&gt;&lt;/STRONG&gt;c" net "&lt;STRONG&gt;a&lt;FONT color="#FF0000"&gt;c&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/FONT&gt;&amp;nbsp;are true, but &lt;FONT face="courier new,courier"&gt;"&lt;STRONG&gt;ab&lt;/STRONG&gt;c" net "&lt;STRONG&gt;ab&lt;/STRONG&gt;"&lt;/FONT&gt; and also&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"&lt;STRONG&gt;a&lt;/STRONG&gt;" net "&lt;STRONG&gt;a&lt;/STRONG&gt;bc"&lt;/FONT&gt; are false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Boolean values resulting from an expression like &lt;FONT face="courier new,courier"&gt;age net 'T'&lt;/FONT&gt; are treated as any other numeric value 0 or 1, e.g., in a numeric variable or as a result of a calculation. In your example, all records with &lt;FONT face="courier new,courier"&gt;age&lt;/FONT&gt; values starting with "T" -- there is only one: "TILL 18" -- take precedence over records with &lt;FONT face="courier new,courier"&gt;age&lt;/FONT&gt; values &lt;EM&gt;not&lt;/EM&gt; starting with "T" because the Boolean values&amp;nbsp;&lt;FONT face="courier new,courier"&gt;age net 'T'&lt;/FONT&gt;&amp;nbsp;(0 or 1) are sorted in ascending numeric order: &lt;FONT face="courier new,courier"&gt;0&lt;/FONT&gt; first, &lt;FONT face="courier new,courier"&gt;1&lt;/FONT&gt; second, as usual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second item in the ORDER BY clause, which could also be written as&lt;/P&gt;
&lt;PRE&gt;order by age net 'T', &lt;STRONG&gt;age&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;determines the sort order &lt;EM&gt;within&lt;/EM&gt; the two groups defined by the first item. Here, it has no impact on the first group because a &lt;EM&gt;single&lt;/EM&gt; record (with &lt;FONT face="courier new,courier"&gt;age="TILL 18"&lt;/FONT&gt;) cannot be sorted in different ways. But it is relevant for the second group: The three character strings &lt;FONT face="courier new,courier"&gt;"18-19"&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;"19-21"&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;"21+"&lt;/FONT&gt; are sorted in ascending alphabetical order, as intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For questions regarding the other procedures you mentioned please open a new thread because they are quite different from PROC SQL, which is the subject of this thread.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 10:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774165#M246006</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-10-14T10:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774173#M246011</link>
      <description>&lt;P&gt;PROC REPORT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have;
column age id n percent;
define age / group format=agefmt. order=data;
define id / noprint;
define percent / computed format=percent7.2;
compute before;
all = n;
endcomp;
compute percent;
percent = n / all;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC SUMMARY/MEANS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have n percent;
format age agefmt.;
class age / order=data;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 10:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774173#M246011</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-14T10:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774174#M246012</link>
      <description>&lt;P&gt;TABULATE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
format age agefmt.;
class age;
tables age,(n pctn);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 10:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774174#M246012</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-14T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774184#M246018</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want that the order of categories in desired output will be in same order as in proc format.&lt;/P&gt;
&lt;P&gt;what is the way to do it please by using proc sql code as below?&lt;/P&gt;
&lt;P&gt;One solution is to write proc format with (a) (b) (c) (d) and so on&amp;nbsp; but it doesnt look&amp;nbsp; nice in output&lt;/P&gt;
&lt;PRE&gt;proc format;
value agefmt
low-18='(a) TILL 18'
18-19='(b) 18-19'
19-21='(c) 19-21'
21-high='(d) 21+'
;
Run;&lt;/PRE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input ID age;
cards;
1 15
2 17
3 18
4 21
5 22
6 19
7 19
8 31
9 39
10 48
11 54
12 17
13 18
;
Run;


proc format;
value agefmt
low-18='TILL 18'
18-19='18-19'
19-21='19-21'
21-high='21+'
;
Run;
title;
PROC SQL;
	select put(age,agefmt.) as age ,
          count(*) as nr  ,
          calculated nr/(select count(*) as  total_nr from  have)*100 as pctN 
	from  have
	group by  calculated age 
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Any procedure that will analyze this data ought to be able to put the results into numerical order without the (a) or (b) or whatever. PROC FREQ and PROC REPORT and PROC SUMMARY (and probably other procedures) all have an ORDER=INTERNAL option which gives you the desired numerical order without the (a) or (b) ...&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 11:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774184#M246018</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-14T11:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774468#M246155</link>
      <description>Is it no needed to write order=internal instead of order=data?&lt;BR /&gt;The ages in the data are not sorted from low to high...&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2021 11:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774468#M246155</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-15T11:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774486#M246165</link>
      <description>&lt;P&gt;You're right, I was fooled by your data ordered in a manner that made it work.&lt;/P&gt;
&lt;P&gt;It's INTERNAL in PROC REPORT and UNFORMATTED in PROC MEANS.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774486#M246165</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-15T13:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774493#M246169</link>
      <description>&lt;P&gt;INTERNAL is a valid alias for UNFORMATTED in PROC MEANS, and so at least in my mind, its easier to remember use INTERNAL for all PROCs where ORDER= is an option.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774493#M246169</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-15T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774495#M246171</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;INTERNAL is a valid alias for UNFORMATTED in PROC MEANS, and so at least in my mind, its easier to remember use INTERNAL for all PROCs where ORDER= is an option.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;++&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774495#M246171</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-15T13:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774603#M246206</link>
      <description>&lt;P&gt;Sorry, I didnt understand.&lt;/P&gt;
&lt;P&gt;In order to sort by unformatted values need to do:&lt;/P&gt;
&lt;P&gt;In PROC MEAN need to use data=Unformatted&lt;/P&gt;
&lt;P&gt;in proc report need to use Data=internal&lt;/P&gt;
&lt;P&gt;Am I correct???&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 19:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774603#M246206</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-10-15T19:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql summary table-order of categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774610#M246207</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, I didnt understand.&lt;/P&gt;
&lt;P&gt;In order to sort by unformatted values need to do:&lt;/P&gt;
&lt;P&gt;In PROC MEAN need to use data=Unformatted&lt;/P&gt;
&lt;P&gt;in proc report need to use Data=internal&lt;/P&gt;
&lt;P&gt;Am I correct???&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC MEANS: you can use ORDER=INTERNAL or ORDER=UNFORMATTED, these are the same. In PROC REPORT, I have only ever used ORDER=INTERNAL. (And not DATA= as you typed)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 20:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-summary-table-order-of-categories/m-p/774610#M246207</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-15T20:25:07Z</dc:date>
    </item>
  </channel>
</rss>

