<?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: How i can do sorting from proc format by second column and not first like it does in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704702#M216061</link>
    <description>when i load the formats in my data the sorting is from first column and not second like i want</description>
    <pubDate>Wed, 09 Dec 2020 13:23:14 GMT</pubDate>
    <dc:creator>alexmathp</dc:creator>
    <dc:date>2020-12-09T13:23:14Z</dc:date>
    <item>
      <title>How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704699#M216058</link>
      <description>&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to ask how we can do sorting from proc format by second column and not first like it does by default.&lt;/P&gt;&lt;P&gt;To make it clear what i mean, i want to my formats to be sorted by second column (the red circle) of the below picture&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52454iBC49A2136CE575DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704699#M216058</guid>
      <dc:creator>alexmathp</dc:creator>
      <dc:date>2020-12-09T13:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704700#M216059</link>
      <description>&lt;P&gt;I dont understand this. You want help to restructure the code or?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704700#M216059</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-09T13:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704701#M216060</link>
      <description>&lt;P&gt;Explain further. There is really no concept of sorting formats in SAS. Where should we see this proper sorting? In the output of some procedure? In a data set?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704701#M216060</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-09T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704702#M216061</link>
      <description>when i load the formats in my data the sorting is from first column and not second like i want</description>
      <pubDate>Wed, 09 Dec 2020 13:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704702#M216061</guid>
      <dc:creator>alexmathp</dc:creator>
      <dc:date>2020-12-09T13:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704704#M216062</link>
      <description>&lt;P&gt;Absolutely irrelevant. When the format is applied, later procedure steps will either order by formatted or unformatted &lt;EM&gt;values&lt;/EM&gt; anyway, depending on the procedure.&lt;/P&gt;
&lt;P&gt;If you want nicely ordered &lt;EM&gt;code&lt;/EM&gt;, shuffle your code lines by selecting and moving.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704704#M216062</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-09T13:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704705#M216063</link>
      <description>&lt;P&gt;Reordering the lines of the code used to generate the format will not have any effect on how the format is defined.&lt;/P&gt;
&lt;P&gt;What is it that you really want to do?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want something else to sort by the formatted values then store the formatted values into a another variable and sort by that.&lt;/P&gt;
&lt;P&gt;If you are using PROC REPORT then use the ORDER=FORMATTED option. Note that is the default ordering for PROC REPORT.&amp;nbsp;&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings11/090-2011.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings11/090-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704705#M216063</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-09T13:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704706#M216064</link>
      <description>Yes i want to my data step to sort by the second column and not first like it does. Tell me if it clear now ok</description>
      <pubDate>Wed, 09 Dec 2020 13:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704706#M216064</guid>
      <dc:creator>alexmathp</dc:creator>
      <dc:date>2020-12-09T13:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704708#M216065</link>
      <description>&lt;P&gt;I want to make fac and bid file from the proc formats that i did already and the sorting to be done from the second column in some cases. If it is applicable of course?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704708#M216065</guid>
      <dc:creator>alexmathp</dc:creator>
      <dc:date>2020-12-09T13:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704709#M216066</link>
      <description>&lt;P&gt;The DATA step does not sort on its own. Certain procedures will order their output automatically.&lt;/P&gt;
&lt;P&gt;If you want PROC SORT to sort by formatted values, you have to create a new variable containing the formatted values first.&lt;/P&gt;
&lt;P&gt;In SQL, you can do that "on the fly":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value mytest
  1 = "B"
  2 = "A"
;

data have;
input value;
format value mytest.;
datalines;
1
2
;

proc sql;
create table want as
  select put(value,mytest.) as value
  from have
  order by calculated value
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704709#M216066</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-09T13:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704716#M216069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/359197"&gt;@alexmathp&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Yes i want to my data step to sort by the second column and not first like it does. Tell me if it clear now ok&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have not answered my questions: "&lt;SPAN&gt;Where should we see this proper sorting? In the output of some procedure? In a data set?"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704716#M216069</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-09T13:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: How i can do sorting from proc format by second column and not first like it does</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704767#M216081</link>
      <description>&lt;P&gt;Please provide code by posting text in a code box.&lt;/P&gt;
&lt;P&gt;I was going to show some affects of Formats and Procedure options but since you did not provide the code for the format as code I could execute I can't. I'm too lazy to retype someone else's work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PROCEDURE you use to display values will depend somewhat as to what you need to do get formatted values in a specific order (or not).&lt;/P&gt;
&lt;P&gt;And since you have the formatted values '09' '07' and '08' appear more than once in the format it is not very clear what expected order you would expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 15:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-can-do-sorting-from-proc-format-by-second-column-and-not/m-p/704767#M216081</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-09T15:46:17Z</dc:date>
    </item>
  </channel>
</rss>

