<?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 fill the blanks within string with underscore in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215307#M39752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you will need to remove the trailing blanks on the fly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data city;&lt;/P&gt;&lt;P&gt;set city;&lt;/P&gt;&lt;P&gt;/*city_name=trim(city_name);*/&lt;/P&gt;&lt;P&gt;city_name=compress(city_name, '-');&lt;/P&gt;&lt;P&gt;city_name=tranwrd(trim(city_name), ' ','_');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 May 2015 21:17:40 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2015-05-14T21:17:40Z</dc:date>
    <item>
      <title>How to fill the blanks within string with underscore</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215306#M39751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to fill blanks with underscore, I have city_name variable that has multiple words, so of them have multiple blanks and dashes (-).&lt;/P&gt;&lt;P&gt;I tried this way:&lt;/P&gt;&lt;P&gt;data city;&lt;/P&gt;&lt;P&gt;set city;&lt;/P&gt;&lt;P&gt;city_name=trim(city_name);&lt;/P&gt;&lt;P&gt;city_name=compres(city_name, '-');&lt;/P&gt;&lt;P&gt;city_name=tranwrd(city_name, ' ','_');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;But I am getting underscores at the end of city name.&amp;nbsp; How to solve this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215306#M39751</guid>
      <dc:creator>nbonda</dc:creator>
      <dc:date>2015-05-14T21:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the blanks within string with underscore</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215307#M39752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you will need to remove the trailing blanks on the fly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data city;&lt;/P&gt;&lt;P&gt;set city;&lt;/P&gt;&lt;P&gt;/*city_name=trim(city_name);*/&lt;/P&gt;&lt;P&gt;city_name=compress(city_name, '-');&lt;/P&gt;&lt;P&gt;city_name=tranwrd(trim(city_name), ' ','_');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215307#M39752</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-05-14T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the blanks within string with underscore</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215308#M39753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you...what's the difference in using trim function separately and on the fly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 12:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215308#M39753</guid>
      <dc:creator>nbonda</dc:creator>
      <dc:date>2015-05-15T12:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the blanks within string with underscore</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215309#M39754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not about trim function or any function, SAS data step uses FIXED length variables, so if not 'on the fly', even the blanks have been removed by Trim function (in this case), Blanks will be padded back in all the way to the length of your variable next time when you call it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 14:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-blanks-within-string-with-underscore/m-p/215309#M39754</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-05-15T14:19:33Z</dc:date>
    </item>
  </channel>
</rss>

