<?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 How to keep only the first &amp;quot;*&amp;quot; sign in a string (drop the others) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-the-first-quot-quot-sign-in-a-string-drop-the/m-p/967516#M376376</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I work for a lab and I have a dataset which contains lab code string with delimiter "*". I have found that only the first "*" is valid (the othres are typo or not useful) and I would like to remove the rest "*" to clean the data. For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*code1 code2 *code3&lt;/P&gt;&lt;P&gt;code1**code2 code3&lt;/P&gt;&lt;P&gt;code1 *code2 *code3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to be&lt;/P&gt;&lt;P&gt;*code1 code2 code3&lt;/P&gt;&lt;P&gt;code1*code2 code3&lt;/P&gt;&lt;P&gt;code1 *code2 code3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 26 May 2025 19:31:32 GMT</pubDate>
    <dc:creator>ballakaay</dc:creator>
    <dc:date>2025-05-26T19:31:32Z</dc:date>
    <item>
      <title>How to keep only the first "*" sign in a string (drop the others)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-the-first-quot-quot-sign-in-a-string-drop-the/m-p/967516#M376376</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I work for a lab and I have a dataset which contains lab code string with delimiter "*". I have found that only the first "*" is valid (the othres are typo or not useful) and I would like to remove the rest "*" to clean the data. For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*code1 code2 *code3&lt;/P&gt;&lt;P&gt;code1**code2 code3&lt;/P&gt;&lt;P&gt;code1 *code2 *code3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to be&lt;/P&gt;&lt;P&gt;*code1 code2 code3&lt;/P&gt;&lt;P&gt;code1*code2 code3&lt;/P&gt;&lt;P&gt;code1 *code2 code3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 19:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-the-first-quot-quot-sign-in-a-string-drop-the/m-p/967516#M376376</guid>
      <dc:creator>ballakaay</dc:creator>
      <dc:date>2025-05-26T19:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep only the first "*" sign in a string (drop the others)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-the-first-quot-quot-sign-in-a-string-drop-the/m-p/967519#M376377</link>
      <description>&lt;P&gt;Removed? Or replaced with a space?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say find where the first one is, then change them all to spaces, then put the first one back again.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;loc= index(string,'*');
string=translate(string,' ','*');
if loc then substr(string,loc,1)='*';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 May 2025 20:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-keep-only-the-first-quot-quot-sign-in-a-string-drop-the/m-p/967519#M376377</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-26T20:31:21Z</dc:date>
    </item>
  </channel>
</rss>

