<?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: using Catx in for combining TWO macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323861#M71845</link>
    <description>&lt;P&gt;It thinks it's a number. Because the function takes char and num types either are valid and it has to guess at types in macro format. I don't know what the rules are, if you're really interested I would contact tech support.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may be able to force it in the SYSFUNC by including quotes around the value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 06:47:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-01-11T06:47:05Z</dc:date>
    <item>
      <title>using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323856#M71842</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have my program as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let date=26Jan2017;&lt;/P&gt;&lt;P&gt;%let time=0012;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dattt= %sysfunc(catx(T,&amp;amp;date,&amp;amp;time));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;dattt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the value for &amp;amp;dattt is 26Jan2017T12,&lt;/P&gt;&lt;P&gt;But i want my value as 26Jan2017T0012,&lt;/P&gt;&lt;P&gt;Why im not getting 0012 for my time.&lt;/P&gt;&lt;P&gt;Please could any one help.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 05:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323856#M71842</guid>
      <dc:creator>navyaroopa</dc:creator>
      <dc:date>2017-01-11T05:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323858#M71843</link>
      <description>&lt;P&gt;Catx converts it to a number. Don't use it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let datt=&amp;amp;date.T&amp;amp;time.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 06:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323858#M71843</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-11T06:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323859#M71844</link>
      <description>&lt;P&gt;I have used &amp;nbsp;&amp;amp;date.T&amp;amp;time &amp;nbsp; as an alternative in the program, but wanted to know Why catx is not working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 06:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323859#M71844</guid>
      <dc:creator>navyaroopa</dc:creator>
      <dc:date>2017-01-11T06:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323861#M71845</link>
      <description>&lt;P&gt;It thinks it's a number. Because the function takes char and num types either are valid and it has to guess at types in macro format. I don't know what the rules are, if you're really interested I would contact tech support.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may be able to force it in the SYSFUNC by including quotes around the value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 06:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323861#M71845</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-11T06:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323866#M71846</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have given with the quotes as&amp;nbsp;%let datt=%sysfunc(catx(T,"&amp;amp;date","&amp;amp;time"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the value but along with the quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be very Thankfull if you could consult &amp;nbsp;tech support and help me to know this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 07:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323866#M71846</guid>
      <dc:creator>navyaroopa</dc:creator>
      <dc:date>2017-01-11T07:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323926#M71853</link>
      <description>&lt;P&gt;Sorry, I meant to say you could contact tech support &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323926#M71853</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-11T14:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: using Catx in for combining TWO macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323931#M71855</link>
      <description>&lt;P&gt;Agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;.&amp;nbsp; I don't see a way to tell CATX that the value that looks like a number is not a number.&amp;nbsp; And generally for concatenation in the macro language CAT functions are not needed, as shown in the accepted solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, if you went the route of adding quote marks, in the macro language those quote marks are part of the value (not a way to indicate that a value is text).&amp;nbsp; The good news is that when a quote mark (or any other non-numeric character) is part of the value, CATX will see that it is not a number.&amp;nbsp; But because those quote marks become part of the value, you would have to removed them yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in theory, you could hack it as something like:&lt;/P&gt;
&lt;PRE&gt;40   %let date=26Jan2017;
41   %let time=0012;
42   %let datt=%sysfunc(compress(%sysfunc(catx(T,"&amp;amp;date","&amp;amp;time")),%str(%")));
43   %put &amp;amp;datt;
26Jan2017T0012
&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-Catx-in-for-combining-TWO-macro-variables/m-p/323931#M71855</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-01-11T14:23:56Z</dc:date>
    </item>
  </channel>
</rss>

