<?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: How do I compare two fields one with leading zeros one without, however some will also have alph in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291141#M59861</link>
    <description>&lt;PRE&gt;
data have;
input aroom$     broom$;
equal_or_not=(aroom=prxchange('s/^0+//',-1,broom));
cards;
451a        0451a
451b        0451b
1              00001
21            00021
1-1           001-1
451a        0451c
;
run;

&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 Aug 2016 05:06:56 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-08-12T05:06:56Z</dc:date>
    <item>
      <title>How do I compare two fields one with leading zeros one without, however some will also have alpha ..</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291095#M59840</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I have two Data Bases that store a field room, one has it with leading zeros and one without, the hitch is these rooms can have a alpha charater?&amp;nbsp;&amp;nbsp; any ideas?&lt;/P&gt;
&lt;P&gt;I had some 1100 false positives now with this just a 100 or so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came up with this:&lt;/P&gt;
&lt;P&gt;put(input(a.room,best4.),z4.) &amp;lt;&amp;gt; put(input(b.room,best4.),z4.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I started with:&lt;/P&gt;
&lt;P&gt;a.room &amp;lt;&amp;gt; b.room&lt;/P&gt;
&lt;P&gt;but with data like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a.room&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.room&lt;/P&gt;
&lt;P&gt;451a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0451a&lt;/P&gt;
&lt;P&gt;451b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0451b&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00001&lt;/P&gt;
&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00021&lt;/P&gt;
&lt;P&gt;1-1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001-1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure what to try to get them down to the true diffences that I want.&amp;nbsp; TIA&amp;nbsp;&amp;nbsp; -KJ&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 23:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291095#M59840</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-08-11T23:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291099#M59843</link>
      <description>&lt;P&gt;PRX functions can be handy,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input aroom$     broom$;
_b=prxchange('s/(^0*)([^0]+.+)/$2/o',-1,broom);
equal_or_not=ifc(aroom=_b,'Y','N');
cards;
451a        0451a
451b        0451b
1              00001
21            00021
1-1           001-1
451a        0451c
;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 23:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291099#M59843</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-08-11T23:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291141#M59861</link>
      <description>&lt;PRE&gt;
data have;
input aroom$     broom$;
equal_or_not=(aroom=prxchange('s/^0+//',-1,broom));
cards;
451a        0451a
451b        0451b
1              00001
21            00021
1-1           001-1
451a        0451c
;
run;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Aug 2016 05:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291141#M59861</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-12T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291145#M59863</link>
      <description>&lt;P&gt;Just a check, but You know that &amp;lt;&amp;gt; is max in SAS?&lt;/P&gt;
&lt;P&gt;In most languages it means Not Equals and from your usage it looks like that's what your using it for? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;The MIN and MAX operators are used to find the minimum or maximum value of two quantities. Surround the operators with the two quantities whose minimum or maximum value you want to know. The MIN (&amp;gt;&amp;lt;) operator returns the lower of the two values. The MAX (&amp;lt;&amp;gt;) operator returns the higher of the two values.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 05:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291145#M59863</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-12T05:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291267#M59870</link>
      <description>&lt;P&gt;Yes I am aware that &amp;lt;&amp;gt; is max, but in "proc sql" it works and works with SQL queries diectly thus we use it...&amp;nbsp;&amp;nbsp; I have been burned by it in data steps so it is playing a bit with fire.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 14:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291267#M59870</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-08-12T14:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291271#M59871</link>
      <description>Sorry I did not say it but my comparison I was using is in a proc sql where, I will check out your function.  I hope it works in a proc sql.</description>
      <pubDate>Fri, 12 Aug 2016 14:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291271#M59871</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-08-12T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare two fields one with leading zeros one without, however some will also have alph</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291283#M59873</link>
      <description>Both answers work equally well for my needs tie goes to the first response.  thanks for your pointer on "prxchange"</description>
      <pubDate>Fri, 12 Aug 2016 14:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-compare-two-fields-one-with-leading-zeros-one-without/m-p/291283#M59873</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-08-12T14:58:46Z</dc:date>
    </item>
  </channel>
</rss>

