<?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 Tabulate sorting issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252783#M48045</link>
    <description>&lt;P&gt;Thanks, that solved the problem. &amp;nbsp;I whacked myself in the head for not seeing that too! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2016 18:52:23 GMT</pubDate>
    <dc:creator>BillB007</dc:creator>
    <dc:date>2016-02-26T18:52:23Z</dc:date>
    <item>
      <title>Proc Tabulate sorting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252723#M48026</link>
      <description>&lt;P&gt;I am importing a lot of Excel files and creating reports using Proc Tabulate. &amp;nbsp; Many&amp;nbsp;work but&amp;nbsp;some don't. &amp;nbsp; The errors I get on some of them are similar to this sample: &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: Data set WORK.REPORT2NEWSORTEDLONG is not sorted in ascending sequence. The current BY group has Assessment Instrument &amp;nbsp;Name = ARED BS CAPS ST&amp;nbsp;Final Candidate and the next BY group has Assessment Instrument Name = ARED BS CAPS ST&amp;nbsp;Final CT."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I know why these are considered out of order, because SAS sorts capital letters before lower case ones, but I sorted these using Proc Sort ahead of time. &amp;nbsp; &amp;nbsp;I also use the option &amp;nbsp;/ORDER=DATA &amp;nbsp;in the class statement of Proc Tabulate and I thought that would make the sort order irrelevant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why I'm having this problem and more importantly, how to solve it?&lt;/P&gt;&lt;P&gt;relevant SAS code below. &amp;nbsp;This is all inside of a macro. &amp;nbsp;The dataset has been re-organized using proc transpose prior to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc tabulate data =&amp;amp;input f=4.0 S=[just=c cellwidth=25];&amp;nbsp;&lt;BR /&gt;var Col1;&lt;BR /&gt;class criterion instrument /ORDER=DATA ;&lt;BR /&gt;class _name_ ;&lt;BR /&gt;table instrument*criterion all={label='Total' s=[just=R background=goldenrod]}*{s=[background=goldenrod]} ,(_name_='Level' ALL)*Col1=" "*(sum="N"*(f=3.0) ROWPCTSUM="%"*f=mypct. ) /box=&amp;amp;reportdate;&lt;BR /&gt;BY instrument;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this on SAS 9.2 and also with SAS 9.4 with the same results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252723#M48026</guid>
      <dc:creator>BillB007</dc:creator>
      <dc:date>2016-02-26T15:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate sorting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252724#M48027</link>
      <description>&lt;P&gt;Please show the sort, the tabulate and then the errors. If you've sorted you shouldn't see the errors, regardless of the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Order=Data controls the display of the rows, but the BY statement is where you're having issues. BY does require a sort.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're confident your data is in a sort order that works for you and is actually sorted in some manner, you can use the NOTSORTED option on your BY statement. Then it treats the data as BY groups but doesn't check for order, but groupings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;BY instrument notsorted;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252724#M48027</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-26T15:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate sorting issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252783#M48045</link>
      <description>&lt;P&gt;Thanks, that solved the problem. &amp;nbsp;I whacked myself in the head for not seeing that too! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 18:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Tabulate-sorting-issue/m-p/252783#M48045</guid>
      <dc:creator>BillB007</dc:creator>
      <dc:date>2016-02-26T18:52:23Z</dc:date>
    </item>
  </channel>
</rss>

