<?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: Use of Substr or Scan in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244705#M6448</link>
    <description>&lt;P&gt;Here are some statements that approximate what you are trying to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_site = scan(site, 3, '-');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_site = scan(site, -1, '-');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I say "approximate" is because you have rules in your head that are not part of the program.&amp;nbsp; For example, consider:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CT-PUNE-MSM PARANJAPE MALL-KARVE ROAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why should the result be PARANJAPE MALL instead of MSM PARANJAPE MALL?&amp;nbsp; You have some rules about that, but all of your rules have to be made known in order to incorporate them into the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2016 14:50:17 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-01-20T14:50:17Z</dc:date>
    <item>
      <title>Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244648#M6441</link>
      <description>&lt;P&gt;Hi I need some help. I have the variable like site with values&lt;/P&gt;
&lt;P&gt;Site&lt;/P&gt;
&lt;P&gt;CT-BENGALURU-J.P.NAGAR&lt;/P&gt;
&lt;P&gt;CT-BENGALURU-ORION MALL&lt;/P&gt;
&lt;P&gt;CT-BENGALURU-SOUL SPACE SPIRIT&lt;/P&gt;
&lt;P&gt;CT-MUMBAI-GOREGAON-OBEROI MALL&lt;/P&gt;
&lt;P&gt;CT-PUNE-ASCENT MALL&lt;/P&gt;
&lt;P&gt;CT-PUNE-MSM PARANJAPE MALL-KARVE ROAD&lt;/P&gt;
&lt;P&gt;I want output like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;J.P.NAGAR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ORION MALL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SOUL SPACE SPIRIT&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;OBEROI MALL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ASCENT MALL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PARANJAPE MALL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 12:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244648#M6441</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2016-01-20T12:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244650#M6442</link>
      <description>&lt;P&gt;I can't see a consistent rule here.&lt;/P&gt;
&lt;P&gt;Usually it's the last "word" of those separatd by hyphens, but in the last line it is the second (and not even the whole second) and not the last. Without a consistent rule, no algorithm can be built.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 12:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244650#M6442</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-20T12:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244653#M6444</link>
      <description>&lt;P&gt;Looks like addresses, right?&lt;/P&gt;
&lt;P&gt;Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;&amp;nbsp;said, there seems not be a clear rule.&lt;/P&gt;
&lt;P&gt;That leaves us to do data standardization.&lt;/P&gt;
&lt;P&gt;And I suspect that addresses are available&amp;nbsp;in the SA Data Quality Base, India edition, contained in the data flux product(s).&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 12:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244653#M6444</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-20T12:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244705#M6448</link>
      <description>&lt;P&gt;Here are some statements that approximate what you are trying to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_site = scan(site, 3, '-');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new_site = scan(site, -1, '-');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I say "approximate" is because you have rules in your head that are not part of the program.&amp;nbsp; For example, consider:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CT-PUNE-MSM PARANJAPE MALL-KARVE ROAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why should the result be PARANJAPE MALL instead of MSM PARANJAPE MALL?&amp;nbsp; You have some rules about that, but all of your rules have to be made known in order to incorporate them into the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 14:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244705#M6448</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-20T14:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244871#M6451</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Site $80.;
length want $ 80;
pid=prxparse('/\w+\s+MALL/i');
if prxmatch(pid,site) then do;
 call prxsubstr(pid,site,p,l);
 want=substr(site,p,l);
 end;
 else want=scan(site,-1,'-');
drop p l;
cards;
CT-BENGALURU-J.P.NAGAR
CT-BENGALURU-ORION MALL
CT-BENGALURU-SOUL SPACE SPIRIT
CT-MUMBAI-GOREGAON-OBEROI MALL
CT-PUNE-ASCENT MALL
CT-PUNE-MSM PARANJAPE MALL-KARVE ROAD
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2016 05:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/244871#M6451</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-21T05:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/245141#M6456</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/245141#M6456</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2016-01-21T12:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Substr or Scan</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/245144#M6457</link>
      <description>&lt;P&gt;Actually there is data inconsistency.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Use-of-Substr-or-Scan/m-p/245144#M6457</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2016-01-21T12:19:18Z</dc:date>
    </item>
  </channel>
</rss>

