<?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: Searching and replacing characters in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810877#M33886</link>
    <description>&lt;P&gt;Thanks , point noted.&lt;/P&gt;</description>
    <pubDate>Sun, 01 May 2022 07:43:23 GMT</pubDate>
    <dc:creator>archita</dc:creator>
    <dc:date>2022-05-01T07:43:23Z</dc:date>
    <item>
      <title>Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810681#M33861</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;PRE&gt;title'silver-level customers';
proc print data=silver;
run;&lt;/PRE&gt;&lt;P&gt;In this code, I am creating three datasets namely silver, gold and platinum based on the customer_id values. I also need to modify any four digit string in customer_id&amp;nbsp; by -15- instead of -00-, the searches are case insensitive.I am not getting the results please help. for e.g customer _id-&amp;nbsp;platinum000-000-00-0010,Silver000-000-00-0024 etc. thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:29:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810681#M33861</guid>
      <dc:creator>archita</dc:creator>
      <dc:date>2022-04-29T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810684#M33863</link>
      <description>&lt;P&gt;Show us a portion of the data before this change, and after.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:35:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810684#M33863</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-29T15:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810695#M33865</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is the input data&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="archita_0-1651248823076.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70989i9940AA9D6D9FA750/image-size/medium?v=v2&amp;amp;px=400" role="button" title="archita_0-1651248823076.png" alt="archita_0-1651248823076.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want it to be -15- in place of -00- , in case of all 4digit&amp;nbsp; string in customer_id.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 16:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810695#M33865</guid>
      <dc:creator>archita</dc:creator>
      <dc:date>2022-04-29T16:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810703#M33866</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    customer_id=tranwrd(customer_id,'-00-,'-15-');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The usual advice here is that we can't write code to test against screen captures of your data. The proper way to provide data from now on is as SAS data step code, which you can type yourself, or use &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;. So from now on, please provide the data as requested.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 17:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810703#M33866</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-29T17:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810810#M33882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The code provided is not working .&lt;/P&gt;&lt;P&gt;My code is;&lt;/P&gt;&lt;P&gt;data silver gold platinum;&lt;BR /&gt;set blib.customers_ex5;&lt;BR /&gt;customer_id=propcase(customer_id);&lt;BR /&gt;if customer_id = 'Silver' then output silver;&lt;BR /&gt;if customer_id = 'Gold' then output gold;&lt;BR /&gt;if customer_id = 'Platinum' then output platinum;&lt;BR /&gt;customer_id = tranwrd(customer_id,'-00-','-15-');&lt;BR /&gt;run;&lt;BR /&gt;title 'silver-level customers';&lt;BR /&gt;proc print data=silver;&lt;BR /&gt;run;&lt;BR /&gt;title'gold-level customers';&lt;BR /&gt;proc print data=silver;&lt;BR /&gt;run;&lt;BR /&gt;title'platinum-level customers';&lt;BR /&gt;proc print data=platinum;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 12:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810810#M33882</guid>
      <dc:creator>archita</dc:creator>
      <dc:date>2022-04-30T12:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810824#M33884</link>
      <description>&lt;P&gt;Changing the value of CUSTOMER_ID after the observation has already been written is not going to have any impact.&lt;/P&gt;
&lt;P&gt;Move the assignment statement before the IF statements that conditionally write the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your IF statements are not going to write any of the observations that had the string '-00-' in them.&lt;/P&gt;
&lt;P&gt;Do you want to test if the START of the value is Silver?&lt;/P&gt;
&lt;P&gt;Use the colon modifier on the comparison operator.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;customer_id=propcase(tranwrd(customer_id,'-00-','-15-'));
if customer_id =: 'Silver' then output silver;
if customer_id =: 'Gold' then output gold;
if customer_id =: 'Platinum' then output platinum;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Apr 2022 16:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810824#M33884</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-30T16:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810844#M33885</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130051"&gt;@archita&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As requested above, it is not sufficient to say it is not working, and provide no other details. If there are errors in the log, then SHOW US the entire log for the step which isn't working (instructions for providing the log already provided, please follow them). If the output is wrong, then SHOW US what output you get, and what you want to get.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 21:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810844#M33885</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-30T21:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810877#M33886</link>
      <description>&lt;P&gt;Thanks , point noted.&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 07:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810877#M33886</guid>
      <dc:creator>archita</dc:creator>
      <dc:date>2022-05-01T07:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Searching and replacing characters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810879#M33887</link>
      <description>&lt;P&gt;Thank you, working now.&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 07:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Searching-and-replacing-characters/m-p/810879#M33887</guid>
      <dc:creator>archita</dc:creator>
      <dc:date>2022-05-01T07:44:45Z</dc:date>
    </item>
  </channel>
</rss>

