<?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 to sort the data with I II III ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417089#M102436</link>
    <description>&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;proc sort sortseq=linguistic(numeric_collation=on);
   by part;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2017-11-29_9-35-57.png" style="width: 123px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16908i525D175002F96A9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2017-11-29_9-35-57.png" alt="2017-11-29_9-35-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2017 15:38:40 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2017-11-29T15:38:40Z</dc:date>
    <item>
      <title>How to sort the data with I II III ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417083#M102434</link>
      <description>&lt;P&gt;Hello, I have a dataset with variable part&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input part $16.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;MD-III_3BQ&lt;/P&gt;&lt;P&gt;MD-II_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MD-I_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MD_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SG-III_5AP&lt;/P&gt;&lt;P&gt;SG-II_5AP&lt;/P&gt;&lt;P&gt;SG-I_5AP&lt;/P&gt;&lt;P&gt;SG_5AP&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output I want is the follows:&lt;/P&gt;&lt;P&gt;MD_3BQ&lt;/P&gt;&lt;P&gt;MD-I_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MD-II_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MD-III_&lt;SPAN&gt;3BQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SG_5AP&lt;/P&gt;&lt;P&gt;SG-I_5AP&lt;/P&gt;&lt;P&gt;SG-II_5AP&lt;/P&gt;&lt;P&gt;SG-III_5AP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I use proc sort, I did not get what I want? Could anyone help me? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417083#M102434</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-29T15:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort the data with I II III ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417089#M102436</link>
      <description>&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;proc sort sortseq=linguistic(numeric_collation=on);
   by part;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2017-11-29_9-35-57.png" style="width: 123px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16908i525D175002F96A9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2017-11-29_9-35-57.png" alt="2017-11-29_9-35-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417089#M102436</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-11-29T15:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort the data with I II III ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417097#M102440</link>
      <description>&lt;P&gt;Thank you Data_null_. That is what I want!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417097#M102440</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-29T15:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort the data with I II III ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417102#M102441</link>
      <description>&lt;P&gt;I can't see a logical way of sorting that data, my advice would be to create either a numeric order variable, or create a format (some people like formats for this type of thing, me I avoid catalogs as much as possible).&amp;nbsp; So either:&lt;/P&gt;
&lt;PRE&gt;data test;
  set test;
  select (part);
    when ("MD-III_3BQ") seq=...;
    when...
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;Or:&lt;/P&gt;
&lt;PRE&gt;proc format;
  value $prt
    "MD-III_3BQ"=...
    "MD-II_3BQ"=...
  ...
  ;
run;

data test;
  set test;
  ord=input(part,$prt.);
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-sort-the-data-with-I-II-III/m-p/417102#M102441</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-29T15:46:48Z</dc:date>
    </item>
  </channel>
</rss>

