<?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: CATX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788264#M251990</link>
    <description>Thanks,&lt;BR /&gt;You wrote  "if XX then Vector=CATX('-',Vector, XX);"&lt;BR /&gt;As I understand it is same to write "if XX ne .  then Vector=CATX('-',Vector, XX);"&lt;BR /&gt;My question:&lt;BR /&gt;How SAS knows that IF XXX   is like IF XXX ne .   ???</description>
    <pubDate>Tue, 04 Jan 2022 13:17:13 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-01-04T13:17:13Z</dc:date>
    <item>
      <title>CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788243#M251971</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am using CATX to concatenate multiple string fields with delimator minus between them.&lt;/P&gt;
&lt;P&gt;In the resulted field I get value&amp;nbsp;100-200-300-.-.-.-.-.-.-.&lt;/P&gt;
&lt;P&gt;However I want to concatenate only mon-missing fields&amp;nbsp; that the value will be&amp;nbsp;100-200-300&lt;/P&gt;
&lt;P&gt;What is the way to correct it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input X1 X2 X3 X4 X5 X6 X7 X X9 X10;
cards;
100 200 300 . . . . . . .
;
Run;

Data wanted;
set have;
Vector=CATX('-',OF X:);
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jan 2022 09:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788243#M251971</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-04T09:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788244#M251972</link>
      <description>&lt;P&gt;CATX() id doing implicit conversion from number to text so "missing value" is set to a "dot",&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input X1 X2 X3 X4 X5 X6 X7 X X9 X10;
cards;
100 200 300 . . . . . . .
;
Run;

Data wanted;
set have;
array XX X:;
length Vector $ 100;
do over XX;
  if XX then Vector=CATX('-',Vector, XX);
end;
Run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 09:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788244#M251972</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2022-01-04T09:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788253#M251980</link>
      <description>&lt;PRE&gt;options missing=' ';
Data wanted;
set have;
Vector=CATX('-',OF X:);
Run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jan 2022 11:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788253#M251980</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-01-04T11:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788264#M251990</link>
      <description>Thanks,&lt;BR /&gt;You wrote  "if XX then Vector=CATX('-',Vector, XX);"&lt;BR /&gt;As I understand it is same to write "if XX ne .  then Vector=CATX('-',Vector, XX);"&lt;BR /&gt;My question:&lt;BR /&gt;How SAS knows that IF XXX   is like IF XXX ne .   ???</description>
      <pubDate>Tue, 04 Jan 2022 13:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788264#M251990</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-04T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788266#M251992</link>
      <description>&lt;P&gt;#maxim1 [&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068&lt;/A&gt;]&lt;/P&gt;
&lt;P&gt;Read the doc.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;In SAS, any numeric value other than 0 or missing is true, and a value of 0 or missing is false.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/lrcon/9.4/p00iah2thp63bmn1lt20esag14lh.htm#p084fxdgd12w4sn1o2xivbvaxmx8" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/lrcon/9.4/p00iah2thp63bmn1lt20esag14lh.htm#p084fxdgd12w4sn1o2xivbvaxmx8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 13:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788266#M251992</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2022-01-04T13:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788302#M252014</link>
      <description>&lt;P&gt;Since your issue resolves around MISSING values consider the options involved with missing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options missing=' ';
Data wanted;
set have;
Vector=CATX('-',OF X:);
Run;
options missing='.';&lt;/LI-CODE&gt;
&lt;P&gt;You get all the - in your result because, as correctly stated by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt; the implicit conversion to the dot character for missing numeric. Setting the Missing option to a blank means the conversion still happens &lt;STRONG&gt;but&lt;/STRONG&gt; CATX will remove all trailing blanks, the only character, and get the desired result.&lt;/P&gt;
&lt;P&gt;When using this approach don't forget to reset the missing option to avoid other possible confusions.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 15:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788302#M252014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-04T15:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: CATX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788305#M252016</link>
      <description>&lt;P&gt;I think a better idea is to use arrays on X1-X10, rather than the much harder creating the proper string with missings '100-200-300' and then working with this string. Then its easy to test to see if X4 is missing and just skip processing in that case.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CATX/m-p/788305#M252016</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-04T17:31:53Z</dc:date>
    </item>
  </channel>
</rss>

