<?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: Find Observations where string starts with specific Characters in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630369#M18881</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines;
input id First_name$8. Last_name&amp;amp;$8.;
datalines;
101 Roy     Rose
102 Yao 	Chen
103 Sushan  Hash
104 Robin   Blue
105 Susan   Robert
106 Susan   Jane
107 Ayesha  Hasan
;
run;

data want;
 set have;
 where prxmatch('/^(Ro|Ay|Su).*/i',First_name) or
 prxmatch('/^(Che|Ro).*/i',Last_name);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 07 Mar 2020 15:44:10 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-03-07T15:44:10Z</dc:date>
    <item>
      <title>Find Observations where string starts with specific Characters</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630367#M18880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to get all the observations where first name starts with Ro, Ay, Su OR Last name starts with Che, Ro.&lt;/P&gt;
&lt;P&gt;I know it's possible to code with Where, IF etc, but can someone help with the coding with Perl, please.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines;
input id First_name$8. Last_name&amp;amp;$8.;
datalines;
101 Roy     Rose
102 Yao 	Chen
103 Sushan  Hash
104 Robin   Blue
105 Susan   Robert
106 Susan   Jane
107 Ayesha  Hasan
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Mar 2020 15:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630367#M18880</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2020-03-07T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find Observations where string starts with specific Characters</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630369#M18881</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines;
input id First_name$8. Last_name&amp;amp;$8.;
datalines;
101 Roy     Rose
102 Yao 	Chen
103 Sushan  Hash
104 Robin   Blue
105 Susan   Robert
106 Susan   Jane
107 Ayesha  Hasan
;
run;

data want;
 set have;
 where prxmatch('/^(Ro|Ay|Su).*/i',First_name) or
 prxmatch('/^(Che|Ro).*/i',Last_name);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Mar 2020 15:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630369#M18881</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-07T15:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Find Observations where string starts with specific Characters</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630371#M18882</link>
      <description>&lt;P&gt;I believe most Stalwarts would still think the following is better, faster and convenient&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile datalines;
input id First_name$8. Last_name&amp;amp;$8.;
datalines;
101 Roy     Rose
102 Yao 	Chen
103 Sushan  Hash
104 Robin   Blue
105 Susan   Robert
106 Susan   Jane
107 Ayesha  Hasan
;
run;

data want;
 set have;
 where First_name in :('Ro','Ay','Su') or
 last_name in  :('Che','Ro'); 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Mar 2020 15:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Find-Observations-where-string-starts-with-specific-Characters/m-p/630371#M18882</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-07T15:47:49Z</dc:date>
    </item>
  </channel>
</rss>

