<?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 hidden quotes from data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529259#M144558</link>
    <description>&lt;P&gt;&lt;SPAN&gt;This question is half a year old, and only the original participants can see that you posted something.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Post your question in a new thread, and include example data and your code, so it's easier for us to help you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jan 2019 20:29:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-01-22T20:29:04Z</dc:date>
    <item>
      <title>how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466783#M119150</link>
      <description>&lt;P&gt;In my data for a variable if i see it looks fine like&lt;/P&gt;
&lt;P&gt;ex - stratos&lt;/P&gt;
&lt;P&gt;if i copy it and check in notepad it becomes&amp;nbsp; "startos" masked with quotes this is becoming problem if i merge data on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to remove these hidden quotes ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 09:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466783#M119150</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2018-06-01T09:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466786#M119151</link>
      <description>&lt;P&gt;Please use the macro from my second footnote to convert the relevant portion of your dataset to a data step and post the resulting code here as advised in my third footnote. Only with having a clear picture of your data will we be able to provide help.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 09:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466786#M119151</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-01T09:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466792#M119153</link>
      <description>&lt;P&gt;Use compress().&amp;nbsp; Also, a quick search on here will reveal several topics with answers already:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/SAS8-How-to-remove-special-characters-from-string/td-p/59186" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/SAS8-How-to-remove-special-characters-from-string/td-p/59186&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 10:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466792#M119153</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-01T10:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466852#M119161</link>
      <description>&lt;P&gt;And how to you "copy it and check in notepad"? Export the data to a text file? Copy from Viewtable view?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 14:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/466852#M119161</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-01T14:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529222#M144538</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you manage to find a solution for this&amp;nbsp;problem?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 19:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529222#M144538</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-22T19:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529224#M144539</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;Compress is not helping in this case! Is there any other way?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 19:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529224#M144539</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-22T19:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529225#M144540</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I am just copying the text from the cell to notepad and I am seeing those extra quotes.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 19:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529225#M144540</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-22T19:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529231#M144542</link>
      <description>&lt;P&gt;When I copy the text to notepad it's like this:&lt;/P&gt;
&lt;P&gt;"""test:{""""text"""":""""test/5.0 (werrwe VV 1.0; Qwe77; y99) TestTestTest/123.89 (ABCD"""&lt;/P&gt;
&lt;P&gt;But when&amp;nbsp;see it in the dataset it's like this:&lt;/P&gt;
&lt;P&gt;"test:{""text"":""test/5.0 (werrwe VV 1.0; Qwe77; y99) TestTestTest/123.89 (ABCD"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried dequote, compress functions&amp;nbsp;it didn't work. Any help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 19:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529231#M144542</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-22T19:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529259#M144558</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This question is half a year old, and only the original participants can see that you posted something.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Post your question in a new thread, and include example data and your code, so it's easier for us to help you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 20:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529259#M144558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-22T20:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove hidden quotes from data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529270#M144566</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42569"&gt;@AshleyBright&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Forget Notepad. When you copy-and-paste into it, what you see may not be what you have in your SAS variable.&lt;/P&gt;
&lt;P&gt;Instead, locate the observation number with the variable value you want to investigate. Suppose this number is 123, your variable in question is called S, and the data set is called HAVE. Run the step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;               
  obs_num = 123 ;             
  set have point = obs_num ;
  do pos = 1 to length (s) ;
    b = char (s, pos) ;     
    put b=$hex2. b= pos= ;  
  end ;                     
  stop ;                    
run ;                       
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and look at the log. For the first 14 positions of the string you've exemplified here, the step will print:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b=22 b=" pos=1&lt;BR /&gt;b=22 b=" pos=2&lt;BR /&gt;b=22 b=" pos=3&lt;BR /&gt;b=74 b=t pos=4&lt;BR /&gt;b=65 b=e pos=5&lt;BR /&gt;b=73 b=s pos=6&lt;BR /&gt;b=74 b=t pos=7&lt;BR /&gt;b=3A b=: pos=8&lt;BR /&gt;b=7B b={ pos=9&lt;BR /&gt;b=22 b=" pos=10&lt;BR /&gt;b=22 b=" pos=11&lt;BR /&gt;b=22 b=" pos=12&lt;BR /&gt;b=22 b=" pos=13&lt;BR /&gt;b=74 b=t pos=14&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will represent the true character content of your string, and you'll be able to determine whether the "quotes" you see in the viewer are really quotes or something else and/or if there're some "hidden" characters you can't see. If some characters that look to you like quotes are in reality other characters, such as not-printables, note their hex values in the log and use them as hex literals with the COMPRESS function to kill them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if you determine from the log that they are real double quotes, only multiplied for some reason, and you want to collapse any number of consecutive double-quotes to a single double-quote, run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;                     
  set have ;                    
  do while (find (s, '""')) ;   
    s = tranwrd (s, '""', '"') ;
  end ;                         
run ;                           
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, if you want to leave no more than 2 consecutive double-quotes in the value of your variable, change the DO loop to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  do while (find (s, '"""')) ;    
    s = tranwrd (s, '"""', '""') ;
  end ;                           
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Anything is possible if you really know what's in your string and what and in which manner you want to change (as long as there's a pattern). But looking at the SAS data after moving them out of the SAS system, especially by copying and pasting, is error-prone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 21:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-hidden-quotes-from-data/m-p/529270#M144566</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-01-22T21:21:08Z</dc:date>
    </item>
  </channel>
</rss>

