<?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: character array concatenation problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615791#M180161</link>
    <description>&lt;P&gt;So mark1 has length 8. So the value is actually the letter 'a' follow by 7 blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark6 also has length 8. So when you append the new letter 'a' to mark1, that would make it 9 characters and so the 9th one gets dropped because the length of mark6 is also 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data array1;
array mark{*} $ mark1-mark5;
array markplusone{*} $ mark6-mark10;
input mark1-mark5;
do i=1 to dim(mark);
markplusone(i)=trim(mark(i))||'a'; /*different concatenation*/
end;
/*drop mark1-mark5;*/
cards;
a b c d e 
;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;markplusone(i)=cats(mark(i),'a');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2020 20:31:57 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-01-07T20:31:57Z</dc:date>
    <item>
      <title>character array concatenation problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615788#M180160</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data array1;
array mark{*} $ mark1-mark5;
array markplusone{*} $ mark6-mark10;
input mark1-mark5;
do i=1 to dim(mark);
markplusone(i)='a'||mark(i);/*different concatenation*/
end;
drop mark1-mark5;
cards;
a b c d e 
;run;

data array1;
array mark{*} $ mark1-mark5;
array markplusone{*} $ mark6-mark10;
input mark1-mark5;
do i=1 to dim(mark);
markplusone(i)=mark(i)||'a'; /*different concatenation*/
end;
drop mark1-mark5;
cards;
a b c d e 
;run;   /*why this concatenation is not working?*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The picture attached below is for the second code output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="array concatnation.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35209i97F4C12A39F87503/image-size/large?v=v2&amp;amp;px=999" role="button" title="array concatnation.PNG" alt="array concatnation.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615788#M180160</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T20:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: character array concatenation problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615791#M180161</link>
      <description>&lt;P&gt;So mark1 has length 8. So the value is actually the letter 'a' follow by 7 blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark6 also has length 8. So when you append the new letter 'a' to mark1, that would make it 9 characters and so the 9th one gets dropped because the length of mark6 is also 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data array1;
array mark{*} $ mark1-mark5;
array markplusone{*} $ mark6-mark10;
input mark1-mark5;
do i=1 to dim(mark);
markplusone(i)=trim(mark(i))||'a'; /*different concatenation*/
end;
/*drop mark1-mark5;*/
cards;
a b c d e 
;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;markplusone(i)=cats(mark(i),'a');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615791#M180161</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-07T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: character array concatenation problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615792#M180162</link>
      <description>Thank you so much, Now I understand!</description>
      <pubDate>Tue, 07 Jan 2020 20:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-array-concatenation-problem/m-p/615792#M180162</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T20:32:12Z</dc:date>
    </item>
  </channel>
</rss>

