<?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: Simplify searching codes? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419602#M67830</link>
    <description>&lt;P&gt;Example input is where?&lt;/P&gt;
&lt;P&gt;Desired output is what?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2017 15:40:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-12-08T15:40:52Z</dc:date>
    <item>
      <title>Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419570#M67824</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Hello:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Could someone help me to simply the codes below? Maybe macro or array? or something else?&amp;nbsp; Thanks.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos1=find(label,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;" NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos2=find(label,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos3=find(label,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"-NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos4=find(label,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS-"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos5=find(label,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"MISC"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Componentpos1=find(Component,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;" NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Componentpos2=find(Component,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Componentpos3=find(Component,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"-NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Componentpos4=find(Component,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS-"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Componentpos5=find(Component,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"MISC"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Productpos1=find(Product,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;" NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Productpos2=find(Product,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS "&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Productpos3=find(Product,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"-NOS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Productpos4=find(Product,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"NOS-"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Productpos5=find(Product,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"MISC"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"i"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nos;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Labelpos1 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Labelpos2 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Labelpos3 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Labelpos4 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Labelpos5 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; or Componentpos1 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Componentpos2 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Componentpos3 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Componentpos4 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Componentpos5 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; or Productpos1 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Productpos2 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Productpos3 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Productpos4 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; or Productpos5 ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 14:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419570#M67824</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-12-08T14:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419585#M67827</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='Could someone help me NOS';
if prxmatch('/NOS| NOS|-NOS|NOS-/i',x) then putlog 'Found';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419585#M67827</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-12-08T15:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419596#M67829</link>
      <description>&lt;P&gt;Or, if you don't need to keep each find location:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
  informat label component product $4.;
  input label component product;
  cards;
this that none
this nos some
the same -nos
not not not
not not misc
;

data want;
  set have (where=(max(
      prxmatch('/NOS| NOS|-NOS|NOS-|MISC/i',label),
      prxmatch('/NOS| NOS|-NOS|NOS-|MISC/i',Component),
      prxmatch('/NOS| NOS|-NOS|NOS-|MISC/i',Product) ) gt 0));
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419596#M67829</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-08T15:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419602#M67830</link>
      <description>&lt;P&gt;Example input is where?&lt;/P&gt;
&lt;P&gt;Desired output is what?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419602#M67830</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-08T15:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419615#M67832</link>
      <description>&lt;P&gt;Hi Art297:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your codes are wonderful.&amp;nbsp;&amp;nbsp; But what is MAX used for?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 16:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419615#M67832</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-12-08T16:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify searching codes?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419617#M67833</link>
      <description>&lt;P&gt;I used max instead of OR. That is, if the largest resulting value from either of the three calls is greater than zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 16:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Simplify-searching-codes/m-p/419617#M67833</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-08T16:33:05Z</dc:date>
    </item>
  </channel>
</rss>

