<?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 Problem with concatenation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-concatenation/m-p/882427#M348628</link>
    <description>&lt;PRE&gt;&lt;CODE class=""&gt;%let source = other_rfb; /* Example value for the macro variable */

data glow;
input id $ source $ class $ country $;
datalines;
11e other mid au
23 other_rfb large eu
123ab other small other in
;
run;

data glow2;
set glow;
length id $200;
if "&amp;amp;source" in ("other", "other_rfb") then do;
id = class || "_under_250k" || country;
end;
else do;
id = class || "_under_250k";
end;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Concatenation is not happening for id coulmn .id just has class values in glow2 dataset. Can you please help with correct code. Tried with cats as well&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 12:54:31 GMT</pubDate>
    <dc:creator>Sathya3</dc:creator>
    <dc:date>2023-06-26T12:54:31Z</dc:date>
    <item>
      <title>Problem with concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-concatenation/m-p/882427#M348628</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;%let source = other_rfb; /* Example value for the macro variable */

data glow;
input id $ source $ class $ country $;
datalines;
11e other mid au
23 other_rfb large eu
123ab other small other in
;
run;

data glow2;
set glow;
length id $200;
if "&amp;amp;source" in ("other", "other_rfb") then do;
id = class || "_under_250k" || country;
end;
else do;
id = class || "_under_250k";
end;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Concatenation is not happening for id coulmn .id just has class values in glow2 dataset. Can you please help with correct code. Tried with cats as well&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 12:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-concatenation/m-p/882427#M348628</guid>
      <dc:creator>Sathya3</dc:creator>
      <dc:date>2023-06-26T12:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-concatenation/m-p/882429#M348629</link>
      <description>&lt;P&gt;Please read the log, it tells you what the problem is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;45    data glow2;
46    set glow;
47    length id $200;
WARNING: Length of character variable id has already been set.
         Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.
48    if "&amp;amp;source" in ("other", "other_rfb") then do;
49    id = class || "_under_250k" || country;
50    end;
51    else do;
52    id = class || "_under_250k";
53    end;
54
55    run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your LENGTH statement didn't do anything where it is located. The LOG even tells you how to fix it.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 13:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-concatenation/m-p/882429#M348629</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-26T13:06:53Z</dc:date>
    </item>
  </channel>
</rss>

