<?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 and order in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447808#M69559</link>
    <description>&lt;P&gt;If you want the data controlled by a variable (numord) and you have other variables with the ORDER role (all of your variables in this case) then that variable would have to be the first one in the column statement, be assigned the role order in define statement. If you do not want the variable to actually appear in the table then use the option NOPRINT in the define statement. Or change the ORDER in your existing&amp;nbsp;define blocks to only the display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using order order&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;display&lt;/SPAN&gt; in a define isn't a good idea as putting two roles, order and display, might yield unexpected results.&lt;/P&gt;
&lt;P&gt;Better for clarity if no other reason would be&lt;/P&gt;
&lt;P&gt;order&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;display&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 15:00:20 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-03-22T15:00:20Z</dc:date>
    <item>
      <title>Proc Report and order</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447732#M69556</link>
      <description>&lt;P&gt;Dear SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use PPOC REPORT with ORDER. The input dataset (parmest) is sorted already by numord. I want the output table (TABLE_SHORT) to be reported in order of numord, but it is coming out in completely different order.&amp;nbsp; See input and output datasets attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=parmest nowd out=table_short;
column variable GROUPS 
('Total-Model 1' Estimate1 StdErr1 Probt1) 
('Total-Model 2' Estimate2 StdErr2 Probt2)
('Total-Model 3' Estimate3 StdErr3 Probt3) 
('Gen. Hosp.-Model 3' Estimate4 StdErr4 Probt4) 
('UMC Hosp.-Model 3' Estimate5 StdErr5 Probt5)
('TC Hosp.-Model 2' Estimate6 StdErr6 Probt6)
('TC Hosp.-Model 3' Estimate7 StdErr7 Probt7)
;
define groups/group noprint;
define Variable /order order=data display;
define estimate1 - estimate7 /order order=data display 'Estimate';
define StdErr1 - StdErr7/order order=data display format=stderrf.;
define probt1 - probt7 /order order=data display;
run;

&lt;BR /&gt;&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, 22 Mar 2018 12:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447732#M69556</guid>
      <dc:creator>GKati</dc:creator>
      <dc:date>2018-03-22T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report and order</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447808#M69559</link>
      <description>&lt;P&gt;If you want the data controlled by a variable (numord) and you have other variables with the ORDER role (all of your variables in this case) then that variable would have to be the first one in the column statement, be assigned the role order in define statement. If you do not want the variable to actually appear in the table then use the option NOPRINT in the define statement. Or change the ORDER in your existing&amp;nbsp;define blocks to only the display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using order order&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;display&lt;/SPAN&gt; in a define isn't a good idea as putting two roles, order and display, might yield unexpected results.&lt;/P&gt;
&lt;P&gt;Better for clarity if no other reason would be&lt;/P&gt;
&lt;P&gt;order&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;display&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447808#M69559</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-22T15:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report and order</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447919#M69561</link>
      <description>Hi:&lt;BR /&gt;  In addition to the very thoughtful comments from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;, please keep in mind that you can only have 1 usage on your DEFINE statement. You have 2 usages: &lt;BR /&gt;define xxx /order order=data display;&lt;BR /&gt;&lt;BR /&gt;ORDER is a usage and DISPLAY is a usage. You can only have 1 usage. You are getting DISPLAY usage and you want ORDER usage. Take off DISPLAY and see what happens. But I am still not sure you are going to get the order you want because you don't show your PROC SORT and you don't have enough DEFINE statements for any of your other variables in the COLUMN statement.&lt;BR /&gt;&lt;BR /&gt;Even if I did open your Excel file, I don't typically write a program to read the file into SAS form because there's no guarantee that the variables would come in as the same types as you have them. &lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Thu, 22 Mar 2018 20:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-and-order/m-p/447919#M69561</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-03-22T20:02:17Z</dc:date>
    </item>
  </channel>
</rss>

