<?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: Removing quoted text from value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778925#M248015</link>
    <description>&lt;P&gt;Peter.C&lt;/P&gt;
&lt;P&gt;If there were multiple quote characters, your code would get wrong result.&lt;/P&gt;
&lt;P&gt;Like this sort of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;input var1 $ 1 - 40;&lt;BR /&gt;datalines;&lt;BR /&gt;hello "dog" is my pet "dog" xxx &lt;BR /&gt;just text &lt;BR /&gt;hi 'people' how are you 'people' &lt;BR /&gt;;

data want;
   set have;
   var1 =prxchange("s/'.*?'|"".*?""//", -1, var1);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Nov 2021 11:04:04 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-11-06T11:04:04Z</dc:date>
    <item>
      <title>Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778749#M247927</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I have some values containing text which can be in single or double quote marks. I would like to remove the quote marks plus the text inside&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;have:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;VAR1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;hello "dog" is my pet&lt;/P&gt;
&lt;P&gt;just text&lt;/P&gt;
&lt;P&gt;hi 'people' how are you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;want:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;VAR1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;hello is my pet&lt;/P&gt;
&lt;P&gt;just text&lt;/P&gt;
&lt;P&gt;hi how are you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 13:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778749#M247927</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-11-05T13:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778759#M247931</link>
      <description>&lt;P&gt;One way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var1 $ 1 - 25;
datalines;
hello "dog" is my pet   
just text               
hi 'people' how are you 
;

data want;
   set have;
   var1 = compbl(prxchange('s/".*"//', -1, prxchange("s/'.*'//", -1, var1)));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Nov 2021 13:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778759#M247931</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-05T13:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778769#M247934</link>
      <description>&lt;P&gt;Thanks for helping..it works perfectly&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 13:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778769#M247934</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-11-05T13:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778772#M247935</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 13:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778772#M247935</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-05T13:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778925#M248015</link>
      <description>&lt;P&gt;Peter.C&lt;/P&gt;
&lt;P&gt;If there were multiple quote characters, your code would get wrong result.&lt;/P&gt;
&lt;P&gt;Like this sort of data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;input var1 $ 1 - 40;&lt;BR /&gt;datalines;&lt;BR /&gt;hello "dog" is my pet "dog" xxx &lt;BR /&gt;just text &lt;BR /&gt;hi 'people' how are you 'people' &lt;BR /&gt;;

data want;
   set have;
   var1 =prxchange("s/'.*?'|"".*?""//", -1, var1);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2021 11:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778925#M248015</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-06T11:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Removing quoted text from value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778926#M248016</link>
      <description>&lt;PRE&gt;data have;
input var1 $ 1 - 40;
datalines;
hello "dog" is my pet "dog" xxx 
just text               
hi 'people' how are you 'people'  
;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Nov 2021 11:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-quoted-text-from-value/m-p/778926#M248016</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-06T11:02:44Z</dc:date>
    </item>
  </channel>
</rss>

