<?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: concatenating two strings in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437632#M109014</link>
    <description>&lt;P&gt;When you use the || operator unless you specifically trim or strip a variable then the variable is padded to its assigned length.&lt;/P&gt;
&lt;P&gt;Please look at the results of this example:&lt;/P&gt;
&lt;PRE&gt;data example;
   length x $ 25 long y z $ 50;
   x= 'short';
   long= x||' word';
   y = strip(x)||' word'  ;
   z = catt(x,' word');
run;&lt;/PRE&gt;
&lt;P&gt;the CATT function (and related CATS) may be better choices than the || operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With out showing how you are getting that result it may be that the split line behavior is attempting to show 50 or 60 characters in a table or view that is only 20 or so wide and so the result is wrapping.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 15:26:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-02-15T15:26:53Z</dc:date>
    <item>
      <title>concatenating two strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437602#M108994</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to concatenate two variables.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;treatment&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; adma;j;j;jkfddddddddddddd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30(ml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both are characters. I tried to concatenate them using " || ".&amp;nbsp; But Im getting like this&amp;nbsp; : &amp;nbsp;adma;j;j;jkfddddddddddddd&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30(ml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;Instead of getting it in one line :&amp;nbsp; &amp;nbsp;adma;j;j;jkfddddddddddddd&amp;nbsp;&amp;nbsp; 30(ml).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't know why. Can someone please help with this?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437602#M108994</guid>
      <dc:creator>rashmirao99</dc:creator>
      <dc:date>2018-02-15T14:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437611#M108999</link>
      <description>&lt;P&gt;Is there a special chaaracter in either of those strings?&amp;nbsp; (Can happen when importing from Excel for instance).&amp;nbsp; Posting test data in the form of a datastep would go a long way to explaining it.&amp;nbsp; Follow this post on how to provide test data:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently there is not much to suggest apart from compressing out special characters:&lt;/P&gt;
&lt;PRE&gt;dose=compress(dose, "0a"x);
&lt;/PRE&gt;
&lt;P&gt;Is one, but there are others.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437611#M108999</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-15T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437614#M109000</link>
      <description>No. There is no special character.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437614#M109000</guid>
      <dc:creator>rashmirao99</dc:creator>
      <dc:date>2018-02-15T15:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437618#M109003</link>
      <description>&lt;P&gt;And how do you know.&amp;nbsp; More importantly, how do we know.&amp;nbsp; We cannot see your system, or your data, or in fact what you are doing, or what you are getting out.&amp;nbsp; None of this information has been provided, hence we cannot help.&amp;nbsp; Provide test data in the form of a datastep.&amp;nbsp; Show what you are doing, then show log and output.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437618#M109003</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-15T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437632#M109014</link>
      <description>&lt;P&gt;When you use the || operator unless you specifically trim or strip a variable then the variable is padded to its assigned length.&lt;/P&gt;
&lt;P&gt;Please look at the results of this example:&lt;/P&gt;
&lt;PRE&gt;data example;
   length x $ 25 long y z $ 50;
   x= 'short';
   long= x||' word';
   y = strip(x)||' word'  ;
   z = catt(x,' word');
run;&lt;/PRE&gt;
&lt;P&gt;the CATT function (and related CATS) may be better choices than the || operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With out showing how you are getting that result it may be that the split line behavior is attempting to show 50 or 60 characters in a table or view that is only 20 or so wide and so the result is wrapping.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenating-two-strings/m-p/437632#M109014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-15T15:26:53Z</dc:date>
    </item>
  </channel>
</rss>

