<?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: Concatenation (||) requires character operands error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601997#M174229</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;"length)col_nm)"&lt;/STRONG&gt;&amp;nbsp; result into a number.&lt;/P&gt;
&lt;P&gt;Try to replace it into:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;"put(length(col_nm), 4. )"&amp;nbsp; &lt;/STRONG&gt;/* adapt length as need - 4 digits or ...? */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;notupper&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;col_nm&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will cause the same problem.&lt;/P&gt;
&lt;P&gt;Using the cats() function (which automatically converts) should fix it.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 14:31:24 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-06T14:31:24Z</dc:date>
    <item>
      <title>Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601991#M174223</link>
      <description>&lt;P&gt;May I know how to overcome the below error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
     select 
          "FAULT_ID = "||compress(f_id)|| " ; "||" IF " || notupper(col_nm)|| " eq " || 0 || " and " || length(col_nm) || " eq " || 3 || " then output ; " 
     into :UPPERCASE
          separated by " "
     from oper_flt_ref
          where category="UPPERCASE" and tbl_nm="INSURANCE";
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;26         proc sql noprint;
27              select
28                   "FAULT_ID = "||compress(f_id)|| " ; "||" IF " || notupper(col_nm)|| " eq " || 0 || " and " || length(col_nm) ||
28       !  " eq " || 3 || " then output ; "
29              into :UPPERCASE
30                   separated by " "
31              from oper_flt_ref
32                   where category="UPPERCASE" and tbl_nm="INSURANCE";
ERROR: Concatenation (||) requires character operands.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
33         quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601991#M174223</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-11-06T14:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601993#M174225</link>
      <description>&lt;P&gt;0 and 3 are numbers; enclose them in quotes to make them strings.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601993#M174225</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T14:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601994#M174226</link>
      <description>&lt;P&gt;You have to ask this question after 900 posts here? Really?&lt;/P&gt;
&lt;P&gt;Sometimes I feel like talking to a brick wall.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601994#M174226</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T14:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601996#M174228</link>
      <description>&lt;P&gt;&lt;STRONG&gt;"length)col_nm)"&lt;/STRONG&gt;&amp;nbsp; result into a number.&lt;/P&gt;
&lt;P&gt;Try to replace it into:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;"put(length(col_nm), 4. )"&amp;nbsp; &lt;/STRONG&gt;/* adapt length as need - 4 digits or ...? */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601996#M174228</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-11-06T14:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601997#M174229</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;"length)col_nm)"&lt;/STRONG&gt;&amp;nbsp; result into a number.&lt;/P&gt;
&lt;P&gt;Try to replace it into:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;"put(length(col_nm), 4. )"&amp;nbsp; &lt;/STRONG&gt;/* adapt length as need - 4 digits or ...? */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;notupper&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;col_nm&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will cause the same problem.&lt;/P&gt;
&lt;P&gt;Using the cats() function (which automatically converts) should fix it.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601997#M174229</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T14:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601999#M174231</link>
      <description>&lt;P&gt;I'm not sure that the &lt;EM&gt;SAS code&lt;/EM&gt; written to macro variable UPPERCASE would be very useful if it contained comparisons of two &lt;EM&gt;constants&lt;/EM&gt; (such as "5 eq 0" or "3 eq 3"). So, maybe quoting the whole function call "&lt;FONT face="courier new,courier"&gt;length(col_nm)&lt;/FONT&gt;" (same with &lt;FONT face="courier new,courier"&gt;notupper&lt;/FONT&gt;) would come closer to what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;needs.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/601999#M174231</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-11-06T14:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602002#M174232</link>
      <description>Where to use cats function?&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602002#M174232</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-11-06T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602009#M174238</link>
      <description>&lt;P&gt;Thinking about it, this is not good at all. Instead of feeding a lot of code into a macro variable (which will sooner or later exceed the 64K limit of macro variables), this should be done in a data step with call execute.&lt;/P&gt;
&lt;P&gt;But this all exceeds&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;'s SAS skills by orders of magnitude, so he/she should refrain from wasting time with this and instead try to learn the SAS basics.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 14:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602009#M174238</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-06T14:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenation (||) requires character operands error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602014#M174241</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Where to use cats function?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;TRY:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select
   cats("FAULT_ID = ", compress(f_id), " ;  IF ", notupper(col_nm), " eq 0 and ", 
           length(col_nm), " eq  3  then output ; ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;.......&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 15:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenation-requires-character-operands-error/m-p/602014#M174241</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-11-06T15:08:19Z</dc:date>
    </item>
  </channel>
</rss>

