<?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: Concatenate stings that contain a number, a dash, and then some text. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600577#M173635</link>
    <description>Concur with Patrick, you likely have a format on your data that is changing the value. &lt;BR /&gt;</description>
    <pubDate>Wed, 30 Oct 2019 22:43:59 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-10-30T22:43:59Z</dc:date>
    <item>
      <title>Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600551#M173624</link>
      <description>&lt;P&gt;I am trying to concatenate several variables that contain strings that are all in a format that starts with a number, then as a space, dash, space, and then some text.&amp;nbsp; For example, "200 - Example text".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No matter what I try, I'm only getting the number part to concatenate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FINAL = catx(', ', of Var1 - VAR3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is resulting in, "200, 1001, 1005" when it should be " 200 - Text, 1001 - Text, 1005 - Text".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 21:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600551#M173624</guid>
      <dc:creator>kryden</dc:creator>
      <dc:date>2019-10-30T21:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600552#M173625</link>
      <description>&lt;P&gt;Do you have sample data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is your example above VAR1 = 200, VAR2 = Example, VAR3 = Text?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: It sounds like you just want to use CAT function not CATX?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 21:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600552#M173625</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-10-30T21:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600564#M173627</link>
      <description>&lt;P&gt;May be this is about formatted and internal values of a variable. Have a look at below and check if that is what's happening to you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value sometext
    100='100 text a'
    200='200 text b'
    300='300 text c'
    ;
quit;

data sample;
  var1=100; var2=200; var3=300;
  format var1 var2 var3 sometext.;
  concat1=catx(',',var1,var2,var3);
  concat2=catx(',',put(var1,sometext.),put(var2,sometext.),put(var3,sometext.));
  output;
  stop;
run;

proc print data=sample;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 522px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33493i8D864D8B513B8AE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 21:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600564#M173627</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-30T21:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600570#M173630</link>
      <description>&lt;P&gt;What variable holds the text value(s)?&lt;/P&gt;
&lt;P&gt;What variable holds the numeric value(s)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that you need to show some actual values and the entire data step that you attempted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &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; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 22:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600570#M173630</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-30T22:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600577#M173635</link>
      <description>Concur with Patrick, you likely have a format on your data that is changing the value. &lt;BR /&gt;</description>
      <pubDate>Wed, 30 Oct 2019 22:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600577#M173635</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-30T22:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate stings that contain a number, a dash, and then some text.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600587#M173639</link>
      <description>&lt;P&gt;Thanks Patrick!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was indeed a formatting issue.&amp;nbsp; As soon as I replaced var_name with put(var_name, format_name.) in the catx expression, I got what I was looking for.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose that this is what I get when trying to code after a &lt;EM&gt;very&lt;/EM&gt; long day!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 23:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-stings-that-contain-a-number-a-dash-and-then-some/m-p/600587#M173639</guid>
      <dc:creator>kryden</dc:creator>
      <dc:date>2019-10-30T23:12:40Z</dc:date>
    </item>
  </channel>
</rss>

