<?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: Sorting in Proc Tabulate in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44359#M5852</link>
    <description>oops, that turned out not so readable.  Hopefully someone can work with that...</description>
    <pubDate>Mon, 08 Sep 2008 17:47:01 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-09-08T17:47:01Z</dc:date>
    <item>
      <title>Sorting in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44358#M5851</link>
      <description>How would I go about sorting by a column in Proc Tabulate?  I am using EG supplemented with coding after to produce the report I want.  The following is my code:&lt;BR /&gt;
&lt;BR /&gt;
%macro _SASTASK_DROPDS(dsname);&lt;BR /&gt;
	%IF %SYSFUNC(EXIST(&amp;amp;dsname)) %THEN %DO;&lt;BR /&gt;
		DROP TABLE &amp;amp;dsname;&lt;BR /&gt;
	%END;&lt;BR /&gt;
	%IF %SYSFUNC(EXIST(&amp;amp;dsname, VIEW)) %THEN %DO;&lt;BR /&gt;
		DROP VIEW &amp;amp;dsname;&lt;BR /&gt;
	%END;&lt;BR /&gt;
%mend _SASTASK_DROPDS;&lt;BR /&gt;
&lt;BR /&gt;
%LET _EGCHARTWIDTH=0;&lt;BR /&gt;
%LET _EGCHARTHEIGHT=0;&lt;BR /&gt;
TITLE;&lt;BR /&gt;
TITLE1 "&lt;FONT size="3pt"&gt;&lt;FONT color="red"&gt;&lt;B&gt;Units with Hours where LMP is Greater Than or Equal to $400&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;";&lt;BR /&gt;
FOOTNOTE;&lt;BR /&gt;
FOOTNOTE1 "&lt;FONT size="3pt"&gt;&lt;B&gt;Generated by the SAS System (&amp;amp;_SASSERVERNAME, &amp;amp;SYSSCPL) on %SYSFUNC(DATE(), EURDFDE9.) at %SYSFUNC(TIME(), TIMEAMPM8.)&lt;/B&gt;&lt;/FONT&gt;";&lt;BR /&gt;
/* -------------------------------------------------------------------&lt;BR /&gt;
   Code generated by SAS Task&lt;BR /&gt;
&lt;BR /&gt;
   Generated on: Monday, September 08, 2008 at 10:00:07 AM&lt;BR /&gt;
   By task: Summary Tables&lt;BR /&gt;
&lt;BR /&gt;
   Input Data: SASUSER.QUERY1_FOR_QUERY1058&lt;BR /&gt;
   Server:  SASMain&lt;BR /&gt;
   ------------------------------------------------------------------- */&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
%_SASTASK_DROPDS(WORK.SORTTempTableSorted);&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/* -------------------------------------------------------------------&lt;BR /&gt;
   Run the tabulate procedure&lt;BR /&gt;
   ------------------------------------------------------------------- */&lt;BR /&gt;
PROC TABULATE&lt;BR /&gt;
DATA=SASUSER.QUERY1_FOR_QUERY1058&lt;BR /&gt;
	STYLE={FONT_SIZE=1 FONT_FACE='Arial' JUST=CENTER VJUST=BOTTOM} FORMAT=DOLLAR12.2 ORDER=Data&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
	;&lt;BR /&gt;
	VAR CLEARED_PRICE_P COST_LMP_P LOSS_LMP_P CONGESTION_LMP_P;&lt;BR /&gt;
	CLASS Time_Interval_S /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	CLASS Scenario_Name /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	CLASS Resource_Name /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	CLASS Congestion_Name /	ORDER=UNFORMATTED MISSING;&lt;BR /&gt;
	TABLE /* Row Dimension */&lt;BR /&gt;
Congestion_Name={LABEL='Congestion Name' STYLE={FONT_SIZE=2} STYLE(CLASSLEV)={FONT_SIZE=1}}*&lt;BR /&gt;
  Resource_Name={LABEL='Resource Name' STYLE={FONT_SIZE=2} STYLE(CLASSLEV)={FONT_SIZE=1}}*&lt;BR /&gt;
    Time_Interval_S={LABEL='Date/Time' STYLE={FONT_SIZE=2} STYLE(CLASSLEV)={FONT_SIZE=1}},&lt;BR /&gt;
/* Column Dimension */&lt;BR /&gt;
Scenario_Name={LABEL='Scenario Name' STYLE={FONT_SIZE=2} STYLE(CLASSLEV)={FONT_SIZE=1}}*(&lt;BR /&gt;
  CLEARED_PRICE_P={LABEL='LMP' STYLE={FONT_SIZE=1}}*&lt;BR /&gt;
    Sum={LABEL='' STYLE={FONT_SIZE=1}}&lt;BR /&gt;
  COST_LMP_P={LABEL='Energy Price' STYLE={FONT_SIZE=1}}*&lt;BR /&gt;
    Sum={LABEL='' STYLE={FONT_SIZE=1}} &lt;BR /&gt;
  LOSS_LMP_P={LABEL='Loss Price' STYLE={FONT_SIZE=1}}*&lt;BR /&gt;
    Sum={LABEL='' STYLE={FONT_SIZE=1}} &lt;BR /&gt;
  CONGESTION_LMP_P={LABEL='Congest. Price' STYLE={FONT_SIZE=1}}*&lt;BR /&gt;
    Sum={LABEL='' STYLE={FONT_SIZE=1}}) 		;&lt;BR /&gt;
	;&lt;BR /&gt;
&lt;BR /&gt;
RUN;&lt;BR /&gt;
/* -------------------------------------------------------------------&lt;BR /&gt;
   End of task code.&lt;BR /&gt;
   ------------------------------------------------------------------- */&lt;BR /&gt;
RUN; QUIT;&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
%_SASTASK_DROPDS(WORK.SORTTempTableSorted);&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
TITLE; FOOTNOTE;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 08 Sep 2008 17:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44358#M5851</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-08T17:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44359#M5852</link>
      <description>oops, that turned out not so readable.  Hopefully someone can work with that...</description>
      <pubDate>Mon, 08 Sep 2008 17:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44359#M5852</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-08T17:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44360#M5853</link>
      <description>Also, I thought I could use ORDER=Data but that did not work for me.</description>
      <pubDate>Mon, 08 Sep 2008 17:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44360#M5853</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-08T17:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44361#M5854</link>
      <description>Hi:&lt;BR /&gt;
  In some instances, you may need to pre-sort your data so the variables are in the right order BEFORE tabulate starts. You should also read the very long &amp;amp; too wordy to quote here topic in the PROC TABULATE documentation. Look for the topic under this path:&lt;BR /&gt;
The Tabulate Procedure --&amp;gt; Results: TABULATE Procedure  or search on the quoted string:&lt;BR /&gt;
"Understanding the Order of Headings with ORDER=DATA"&lt;BR /&gt;
and you will come up with 3 hits -- one on the CLASS statement, one on the PROC TABULATE statement and one on the Results Topic, as described above.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 08 Sep 2008 19:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44361#M5854</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-09-08T19:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44362#M5855</link>
      <description>Thanks Cynthia!  I got it to work by presorting the data then ordering the row assignments to ORDER=DATA.&lt;BR /&gt;
&lt;BR /&gt;
Many thanks!</description>
      <pubDate>Mon, 08 Sep 2008 20:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Sorting-in-Proc-Tabulate/m-p/44362#M5855</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-08T20:17:05Z</dc:date>
    </item>
  </channel>
</rss>

