<?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: Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string lengt in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/596282#M34912</link>
    <description>&lt;P&gt;Do you know why this happens?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 15:06:08 GMT</pubDate>
    <dc:creator>sass_numero_uno</dc:creator>
    <dc:date>2019-10-14T15:06:08Z</dc:date>
    <item>
      <title>Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string length?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594473#M34834</link>
      <description>&lt;P&gt;[SAS 7.1] Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string length to the longest string in that field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;12&lt;/P&gt;&lt;P&gt;123&lt;/P&gt;&lt;P&gt;1234&lt;/P&gt;&lt;P&gt;12345&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When reversed, becomes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1____&lt;/P&gt;&lt;P&gt;21___&lt;/P&gt;&lt;P&gt;321__&lt;/P&gt;&lt;P&gt;4321_&lt;/P&gt;&lt;P&gt;54321&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where underscores represent blanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 14:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594473#M34834</guid>
      <dc:creator>sass_numero_uno</dc:creator>
      <dc:date>2019-10-07T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string lengt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594475#M34835</link>
      <description>&lt;P&gt;SAS pads strings with blanks to take up the assigned length.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This only becomes apparent when you're trying to do something and white space is a factor, such as string functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294069"&gt;@sass_numero_uno&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;[SAS 7.1] Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string length to the longest string in that field?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;12&lt;/P&gt;
&lt;P&gt;123&lt;/P&gt;
&lt;P&gt;1234&lt;/P&gt;
&lt;P&gt;12345&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reversed, becomes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1____&lt;/P&gt;
&lt;P&gt;21___&lt;/P&gt;
&lt;P&gt;321__&lt;/P&gt;
&lt;P&gt;4321_&lt;/P&gt;
&lt;P&gt;54321&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where underscores represent blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 15:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594475#M34835</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-07T15:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string lengt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594510#M34836</link>
      <description>&lt;P&gt;They don't ADD any spaces.&amp;nbsp; They just don't remove them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your description of the how REVERSE works is wrong.&amp;nbsp; If you reverse a string of length 5 then the original trailing spaces will now be at&amp;nbsp; the beginning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you started with values that had LEADING spaces?&amp;nbsp; Perhaps as the output of the PUT() function or some other numeric to character conversion?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that the normal PUT statement that either does not use a format or uses the generic character format $ will remove leading/trailing&amp;nbsp; spaces while writing.&amp;nbsp; You can use a different format to see the spaces. Like $CHAR or $QUOTE format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 17:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/594510#M34836</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-07T17:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why do certain functions such as REVERSE and TRANSLATE add trailing blanks to match string lengt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/596282#M34912</link>
      <description>&lt;P&gt;Do you know why this happens?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Why-do-certain-functions-such-as-REVERSE-and-TRANSLATE-add/m-p/596282#M34912</guid>
      <dc:creator>sass_numero_uno</dc:creator>
      <dc:date>2019-10-14T15:06:08Z</dc:date>
    </item>
  </channel>
</rss>

