<?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 Search for a string with various special characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675640#M203587</link>
    <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading several XML files as flat-files ... Imagine now i have a dataset XML3, with two columns:&lt;/P&gt;&lt;P&gt;xmlname (e.g.: XML_number1.xml), text1(several hundret alphanumeric characters, this is the xml-content).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA xml4_codesys(KEEP = xmlname codesys_flg);
      SET xml3;
      FORMAT codesys_flg best8.;
      codesys_string = INDEX(text1, %str(&amp;lt;name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/&amp;gt;));
        IF codesys_string NE 0 THEN DO;
          codesys_flg = 1;
        END;
        ELSE DO;
          codesys_flg = 0;
        RUN;
    RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;First attempt with the %str() masking did not help unfortunately &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The string i want to search for is exactly this one:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;lt;name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does someone has an easy solution without complex PERL-Reg-Expressions? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any idea,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2020 15:57:33 GMT</pubDate>
    <dc:creator>Felix_</dc:creator>
    <dc:date>2020-08-10T15:57:33Z</dc:date>
    <item>
      <title>Search for a string with various special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675640#M203587</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading several XML files as flat-files ... Imagine now i have a dataset XML3, with two columns:&lt;/P&gt;&lt;P&gt;xmlname (e.g.: XML_number1.xml), text1(several hundret alphanumeric characters, this is the xml-content).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA xml4_codesys(KEEP = xmlname codesys_flg);
      SET xml3;
      FORMAT codesys_flg best8.;
      codesys_string = INDEX(text1, %str(&amp;lt;name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/&amp;gt;));
        IF codesys_string NE 0 THEN DO;
          codesys_flg = 1;
        END;
        ELSE DO;
          codesys_flg = 0;
        RUN;
    RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;First attempt with the %str() masking did not help unfortunately &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The string i want to search for is exactly this one:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;lt;name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does someone has an easy solution without complex PERL-Reg-Expressions? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any idea,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 15:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675640#M203587</guid>
      <dc:creator>Felix_</dc:creator>
      <dc:date>2020-08-10T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Search for a string with various special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675644#M203589</link>
      <description>&lt;P&gt;Try to change the %str with single quotes :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;codesys_string = INDEX(text1, '&amp;lt;name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/&amp;gt;');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2020 16:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675644#M203589</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-08-10T16:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Search for a string with various special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675823#M203658</link>
      <description>&lt;P&gt;Sometimes, Solutions can be so easy &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; Thank you 'Shmuel' !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and sometimes you should Close the day after 10+ hours xD&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 06:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Search-for-a-string-with-various-special-characters/m-p/675823#M203658</guid>
      <dc:creator>Felix_</dc:creator>
      <dc:date>2020-08-11T06:11:51Z</dc:date>
    </item>
  </channel>
</rss>

