<?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: How to remove multiple double quotes in a macro variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483926#M287009</link>
    <description>&lt;P&gt;Not sure, as I don't comprehend the flow of data in your process but a simple demo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let k="ironman@marvel.com" "thor@marvel.com" "hulk@marvel.com";
%put &amp;amp;k;
%let k1=%sysfunc(compress(%superq(k),%str(%")));
%put &amp;amp;k1 ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Aug 2018 21:07:26 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-08-03T21:07:26Z</dc:date>
    <item>
      <title>How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483925#M287008</link>
      <description>&lt;P&gt;Hi all. We have a list of emails that I'm trying to store in a table that looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ironman@marvel.com" "thor@marvel.com" "hulk@marvel.com"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is passed onto a macro var &amp;amp;team. It is then called out in a proc sql that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table avengers as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;"&amp;amp;team." as members&lt;/P&gt;&lt;P&gt;from earth&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However SAS sees the double quotes and gets all confused. It won't let me use single quotes. I've tried compress and tranwrd, those are not working either. Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 20:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483925#M287008</guid>
      <dc:creator>Vestax</dc:creator>
      <dc:date>2018-08-03T20:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483926#M287009</link>
      <description>&lt;P&gt;Not sure, as I don't comprehend the flow of data in your process but a simple demo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let k="ironman@marvel.com" "thor@marvel.com" "hulk@marvel.com";
%put &amp;amp;k;
%let k1=%sysfunc(compress(%superq(k),%str(%")));
%put &amp;amp;k1 ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Aug 2018 21:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483926#M287009</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-03T21:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483943#M287010</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Not sure, as I don't comprehend the flow of data in your process but a simple demo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let k="ironman@marvel.com" "thor@marvel.com" "hulk@marvel.com";
%put &amp;amp;k;
%let k1=%sysfunc(compress(%superq(k),%str(%")));
%put &amp;amp;k1 ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're trying to store the string in the macro variable as an observation. Your solution works somewhat but what if there are no spaces and the data coming in looks like&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let k="ironman@marvel.com""thor@marvel.com""hulk@marvel.com";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is it possible to add spaces or remove the double quotes without compressing the spaces?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 23:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483943#M287010</guid>
      <dc:creator>Vestax</dc:creator>
      <dc:date>2018-08-03T23:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483944#M287011</link>
      <description>&lt;P&gt;Any reason you can’t do this instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select &amp;amp;team as members....&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 23:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483944#M287011</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-03T23:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483947#M287012</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224558"&gt;@Vestax&lt;/a&gt;&amp;nbsp;have you tried translate instead of trnwrd?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let k="ironman@marvel.com""thor@marvel.com""hulk@marvel.com";
%put &amp;amp;k;
%let k1=%sysfunc(translate(%superq(k),%str( ),%str(%")));
%put &amp;amp;k1 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think somebody who is senior and wiser&amp;nbsp; would prolly even suggest a better design of the data flow process or even table design. The manual operation seems wary. But anyway up to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 23:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483947#M287012</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-03T23:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483948#M287013</link>
      <description>The PROC SQL doesn't like that there multiple double quotes. After the second double quote, it errors out.</description>
      <pubDate>Fri, 03 Aug 2018 23:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483948#M287013</guid>
      <dc:creator>Vestax</dc:creator>
      <dc:date>2018-08-03T23:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove multiple double quotes in a macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483949#M287014</link>
      <description>This works as intended. Thanks for your help.</description>
      <pubDate>Fri, 03 Aug 2018 23:47:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-multiple-double-quotes-in-a-macro-variable/m-p/483949#M287014</guid>
      <dc:creator>Vestax</dc:creator>
      <dc:date>2018-08-03T23:47:16Z</dc:date>
    </item>
  </channel>
</rss>

