<?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: Call Sortc Not working as expected in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477856#M123149</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16600"&gt;@SASPhile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The values I'm getting after using&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; dr3 &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;hex2&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;65&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;'65'x is just a lower case E.&amp;nbsp; But since 'C2'x has the high order bit set it is NOT a normal ASCII code.&amp;nbsp; So its meaning depends on the encoding setting you are using.&amp;nbsp; If you where using LATIN encoding it would probably be an uppercase A with umlaut over it.&amp;nbsp; Since you say it looks like a space you are probably using UTF8 encoding so the meaning depends on the characters that follow it.&amp;nbsp; Run the simple test again with a longer width on the $HEX. format to see the hex codes for more bytes in the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you have the string 'C2A0'x which is UTF8 code for a "non-breaking" space.&amp;nbsp; COMPRESS() might not be the right tool to use to remove that since it works on single bytes.&amp;nbsp; So if you asked compress to remove 'C2A0'x it would remove ALL of the bytes that were either 'C2'x or 'A0'x.&amp;nbsp; So if you had some other UTF8 code that started with 'C2' it get messed up.&amp;nbsp; So try using TRANWRD() instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;drx3 = strip(tranwrd(dr3,'C2A0'x,' '));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should also look into HOW this non-ASCII code got into your variable's value to begin with.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jul 2018 13:04:18 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-07-13T13:04:18Z</dc:date>
    <item>
      <title>Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477695#M123085</link>
      <description>&lt;P&gt;&lt;BR /&gt;data test;&lt;BR /&gt;dr1='dxxxxxxxx';&lt;BR /&gt;dr2='&amp;nbsp;bxxxxxxxx';&lt;BR /&gt;dr3='&amp;nbsp;daxxxxxxxxx';&lt;BR /&gt;dr4='&amp;nbsp;vxxxxxxxx';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;data test1;;&lt;BR /&gt;&amp;nbsp;set test;&lt;BR /&gt;&amp;nbsp;length Drx1-Drx4 $100;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Drx1=strip(dr1);&lt;BR /&gt;&amp;nbsp;Drx2=strip(dr2);&lt;BR /&gt;&amp;nbsp;Drx3=strip(dr3);&lt;BR /&gt;&amp;nbsp;Drx4=strip(dr4);&lt;BR /&gt;&amp;nbsp;call sortc (of drx1-drx4);&lt;BR /&gt;&amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Expected order is:&lt;BR /&gt;&amp;nbsp;bxxxxxxxx daxxxxxxxxx dxxxxxxxx vxxxxxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the output is not expected output&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 22:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477695#M123085</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-07-12T22:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477701#M123087</link>
      <description>&lt;P&gt;Are you sure? Your example worked perfectly for me. What version of SAS are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_drx.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21765i29A9FE2F95ACC8A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_drx.PNG" alt="delete_drx.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16600"&gt;@SASPhile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;data test;&lt;BR /&gt;dr1='dxxxxxxxx';&lt;BR /&gt;dr2='&amp;nbsp;bxxxxxxxx';&lt;BR /&gt;dr3='&amp;nbsp;daxxxxxxxxx';&lt;BR /&gt;dr4='&amp;nbsp;vxxxxxxxx';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;data test1;;&lt;BR /&gt;&amp;nbsp;set test;&lt;BR /&gt;&amp;nbsp;length Drx1-Drx4 $100;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Drx1=strip(dr1);&lt;BR /&gt;&amp;nbsp;Drx2=strip(dr2);&lt;BR /&gt;&amp;nbsp;Drx3=strip(dr3);&lt;BR /&gt;&amp;nbsp;Drx4=strip(dr4);&lt;BR /&gt;&amp;nbsp;call sortc (of drx1-drx4);&lt;BR /&gt;&amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Expected order is:&lt;BR /&gt;&amp;nbsp;bxxxxxxxx daxxxxxxxxx dxxxxxxxx vxxxxxxxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the output is not expected output&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 22:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477701#M123087</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-12T22:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477717#M123092</link>
      <description>&lt;P&gt;Does your log show any errors such that a previous data set wasn't replaced? Or are you discussing other data where the XXX values are different than actually shown? You may have hidden something that affects the sort order with the xs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show your actual result. Mine matches your expected as well.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 23:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477717#M123092</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-12T23:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477728#M123098</link>
      <description>&lt;P&gt;No Errors in log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; data test;&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; dr1='dxxxxxxxx';&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; dr2='&amp;nbsp;bxxxxxxxx';&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; dr3='&amp;nbsp;daxxxxxxxxx';&lt;BR /&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; dr4='&amp;nbsp;vxxxxxxxx';&lt;BR /&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.TEST has 1 observations and 4 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.14 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;7&lt;BR /&gt;8&lt;BR /&gt;9&lt;BR /&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp; data test1;;&lt;BR /&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp; set test;&lt;BR /&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp; length Drx1-Drx4 $100;&lt;BR /&gt;13&lt;BR /&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp; Drx1=strip(dr1);&lt;BR /&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp; Drx2=strip(dr2);&lt;BR /&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp; Drx3=strip(dr3);&lt;BR /&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp; Drx4=strip(dr4);&lt;BR /&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp; call sortc (of drx1-drx4);&lt;BR /&gt;19&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: The data set WORK.TEST1 has 1 observations and 8 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.08 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 00:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477728#M123098</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-07-13T00:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477730#M123100</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Screen or print of output?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My debugging steps would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Restart SAS&lt;/P&gt;
&lt;P&gt;2. I would check your SAS options, see if any are related to sorting,&lt;/P&gt;
&lt;P&gt;3. and then if it persists, contact SAS tech support.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 00:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477730#M123100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-13T00:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477731#M123101</link>
      <description>Check the SORTSEQ option.</description>
      <pubDate>Fri, 13 Jul 2018 00:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477731#M123101</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-13T00:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477734#M123102</link>
      <description>&lt;P&gt;Works fine for me.&lt;/P&gt;
&lt;PRE&gt;233  data test1;;
234    set test;
235    length Drx1-Drx4 $20;
236
237    Drx1=strip(dr1);
238    Drx2=strip(dr2);
239    Drx3=strip(dr3);
240    Drx4=strip(dr4);
241    call sortc (of drx1-drx4);
242
243    put (_all_) (=:$quote. /) ;
244  run;

dr1="dxxxxxxxx"
dr2=" bxxxxxxxx"
dr3=" daxxxxxxxxx"
dr4=" vxxxxxxxx"
Drx1="bxxxxxxxx"
Drx2="daxxxxxxxxx"
Drx3="dxxxxxxxx"
Drx4="vxxxxxxxx"
NOTE: There were 1 observations read from the data set WORK.TEST.
NOTE: The data set WORK.TEST1 has 1 observations and 8 variables.&lt;/PRE&gt;
&lt;P&gt;Perhaps those are not actual spaces in the beginning of your variable values?&lt;/P&gt;
&lt;PRE&gt;246  data test;
247    dr1='dxxxxxxxx';
248    dr2=' bxxxxxxxx';
249    dr3=' daxxxxxxxxx';
250    dr3='00'x || 'daxxxxxxxxx' ;
251    dr4=' vxxxxxxxx';
252  run;

NOTE: The data set WORK.TEST has 1 observations and 4 variables.

253
254  data test1;;
255    set test;
256    length Drx1-Drx4 $20;
257
258    Drx1=strip(dr1);
259    Drx2=strip(dr2);
260    Drx3=strip(dr3);
261    Drx4=strip(dr4);
262    call sortc (of drx1-drx4);
263
264    put (_all_) (=:$quote. /) ;
265  run;

dr1="dxxxxxxxx"
dr2=" bxxxxxxxx"
dr3=" daxxxxxxxxx"
dr4=" vxxxxxxxx"
Drx1=" daxxxxxxxxx"
Drx2="bxxxxxxxx"
Drx3="dxxxxxxxx"
Drx4="vxxxxxxxx"
NOTE: There were 1 observations read from the data set WORK.TEST.
NOTE: The data set WORK.TEST1 has 1 observations and 8 variables.&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 00:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477734#M123102</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-13T00:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477738#M123104</link>
      <description>&lt;P&gt;how to remove the leading spaces ? I tried compress,strip etc. Nothing seems to do the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 01:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477738#M123104</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-07-13T01:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477757#M123109</link>
      <description>&lt;P&gt;It is NOT a space.&amp;nbsp; That is why STRIP() didn't work.&lt;/P&gt;
&lt;P&gt;So ask SAS to tell you what character it is.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put dr3 $hex2. ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then tell COMPRESS() to remove that character.&amp;nbsp; So if it is a binary zero like in my example you could use this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;drx3=strip(compress(dr3,'00'x));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 02:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477757#M123109</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-13T02:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477849#M123144</link>
      <description>&lt;P&gt;The values I'm getting after using&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; dr3 &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;hex2&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;65&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 12:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477849#M123144</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-07-13T12:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477856#M123149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16600"&gt;@SASPhile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The values I'm getting after using&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; dr3 &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;hex2&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;65&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;C2&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;'65'x is just a lower case E.&amp;nbsp; But since 'C2'x has the high order bit set it is NOT a normal ASCII code.&amp;nbsp; So its meaning depends on the encoding setting you are using.&amp;nbsp; If you where using LATIN encoding it would probably be an uppercase A with umlaut over it.&amp;nbsp; Since you say it looks like a space you are probably using UTF8 encoding so the meaning depends on the characters that follow it.&amp;nbsp; Run the simple test again with a longer width on the $HEX. format to see the hex codes for more bytes in the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you have the string 'C2A0'x which is UTF8 code for a "non-breaking" space.&amp;nbsp; COMPRESS() might not be the right tool to use to remove that since it works on single bytes.&amp;nbsp; So if you asked compress to remove 'C2A0'x it would remove ALL of the bytes that were either 'C2'x or 'A0'x.&amp;nbsp; So if you had some other UTF8 code that started with 'C2' it get messed up.&amp;nbsp; So try using TRANWRD() instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;drx3 = strip(tranwrd(dr3,'C2A0'x,' '));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should also look into HOW this non-ASCII code got into your variable's value to begin with.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 13:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477856#M123149</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-13T13:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call Sortc Not working as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477875#M123159</link>
      <description>&lt;P&gt;I used compress(dr3,,'kw') and it worked. (keep only printable characters)! Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-Sortc-Not-working-as-expected/m-p/477875#M123159</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-07-13T14:32:44Z</dc:date>
    </item>
  </channel>
</rss>

