<?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: flagging up duplicates with incorrect decimal places in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293633#M61162</link>
    <description>&lt;P&gt;How is it possible that the last two lines of data both generate the same AMT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to actually describe the outcome that you would like. &amp;nbsp;Showing nonworking code makes it difficult to determine your objective here.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 06:21:45 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-08-24T06:21:45Z</dc:date>
    <item>
      <title>flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293630#M61159</link>
      <description>&lt;P&gt;I have a data like this&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;input amt1 amt2;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;100.00 6000.10&lt;/P&gt;&lt;P&gt;60.00 60000.01&lt;/P&gt;&lt;P&gt;6000.00 60.00&lt;/P&gt;&lt;P&gt;60.00 600.00&lt;/P&gt;&lt;P&gt;60.00 1000.00&lt;/P&gt;&lt;P&gt;14.00 14500.00&lt;/P&gt;&lt;P&gt;-10.00 -1000000.00&lt;/P&gt;&lt;P&gt;15001 15.001&lt;/P&gt;&lt;P&gt;15.001 15001&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have it flagged as below&lt;/P&gt;&lt;P&gt;amt1 amt2 amt flag&lt;BR /&gt;100 6000.1 60 .&lt;BR /&gt;60 60000.01 1000 1&lt;BR /&gt;6000 60 100 1&lt;BR /&gt;60 600 10 1&lt;BR /&gt;60 1000 16.66667 .&lt;BR /&gt;14 14500 1035.714 .&lt;BR /&gt;-10 -1000000 100000 1&lt;BR /&gt;15001 15.001 1000.067 1&lt;BR /&gt;15.001 15001 1000.067 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the bit of code i have written but is not solving the purpose&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;amt = (int(substr(amt1,1,find(amt1,"."))))/(int(substr(amt2,1,find(amt2,"."))));&lt;/P&gt;&lt;P&gt;if amt =1 or amt = 0.1 or amt=0.01 or amt = 0.001 or amt = 0.0001 then good = 1; else good=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 05:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293630#M61159</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T05:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293633#M61162</link>
      <description>&lt;P&gt;How is it possible that the last two lines of data both generate the same AMT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to actually describe the outcome that you would like. &amp;nbsp;Showing nonworking code makes it difficult to determine your objective here.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 06:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293633#M61162</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-24T06:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293636#M61165</link>
      <description>&lt;P&gt;What are the rules (in spoken language) for&lt;/P&gt;
&lt;P&gt;- calculating amt&lt;/P&gt;
&lt;P&gt;- setting flag&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 06:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293636#M61165</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-24T06:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293646#M61172</link>
      <description>The flagging reason is incorrect decimal places used&lt;BR /&gt;like the real amt is 60.00 however written as 600.00 sho it should be flagged up</description>
      <pubDate>Wed, 24 Aug 2016 09:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293646#M61172</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293650#M61175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39863"&gt;@rahul88888&lt;/a&gt; wrote:&lt;BR /&gt;The flagging reason is incorrect decimal places used&lt;BR /&gt;like the real amt is 60.00 however written as 600.00 sho it should be flagged up&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But how do we know what's wrong? That it should be 60 vs 600?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 09:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293650#M61175</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-24T09:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293660#M61184</link>
      <description>&lt;P&gt;We are not saying it as wrong just flagging it up to say it might be a mistake&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 10:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293660#M61184</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T10:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293663#M61186</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39863"&gt;@rahul88888&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;We are not saying it as wrong just flagging it up to say it might be a mistake&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So how do we know it might be a mistake?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 10:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293663#M61186</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-24T10:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293755#M61210</link>
      <description>&lt;P&gt;Here's a hint for providing and talking about example data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Do not provide multiple example data values and then reference one of those values without context.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39863"&gt;@rahul88888&lt;/a&gt; wrote:&lt;BR /&gt;The flagging reason is incorrect decimal places used&lt;BR /&gt;like the real amt is 60.00 however written as 600.00 sho it should be flagged up&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Your example data has the value 60 repeated 4 times and 6000 3 times. So when you say 60 or 6000 we have no way to tell which other information may be important. &lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Is there supposed to be some relationship between amt1 and amt2 that you have not mentioned? Or is there some "rule" involving multiple rows of data?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 15:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293755#M61210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-24T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293756#M61211</link>
      <description>&lt;P&gt;Here's a hint for providing and talking about example data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;Do not provide multiple example data values and then reference one of those values without context.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39863"&gt;@rahul88888&lt;/a&gt; wrote:&lt;BR /&gt;The flagging reason is incorrect decimal places used&lt;BR /&gt;like the real amt is 60.00 however written as 600.00 sho it should be flagged up&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Your example data has the value 60 repeated 4 times and 6000 3 times. So when you say 60 or 6000 we have no way to tell which other information may be important. &lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Is there supposed to be some relationship between amt1 and amt2 that you have not mentioned? Or is there some "rule" involving multiple rows of data?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 15:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293756#M61211</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-24T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293762#M61214</link>
      <description>&lt;P&gt;Lets say my data set looks like this&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;amt1&lt;/TD&gt;&lt;TD&gt;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t;800000.01&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6000&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;14500&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-10&lt;/TD&gt;&lt;TD&gt;-1000000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15001&lt;/TD&gt;&lt;TD&gt;15.001&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15.001&lt;/TD&gt;&lt;TD&gt;15001&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats all the problem is decimals have been incorrectly put or something. We just need to flag it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 15:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293762#M61214</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T15:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293798#M61227</link>
      <description>&lt;P&gt;Check if amt1 and amt 2 have the same sign and&amp;nbsp;&amp;nbsp;check if log10(amt1/amt2) is an integer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if amt1/amt2&amp;gt;0 and int(log10(amt1/amt2))=log10(amt1/amt2) then flag=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Aug 2016 18:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293798#M61227</guid>
      <dc:creator>JohnHoughton</dc:creator>
      <dc:date>2016-08-24T18:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: flagging up duplicates with incorrect decimal places</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293923#M61280</link>
      <description>I had multiplied it earlier both abs(amt1) and abs(amt2) with 10^50 and changed the number to string matched the first 48 characters and completed it. The solution you have given is petty awesome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; rather than doing it in 3 steps.&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Aug 2016 03:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-up-duplicates-with-incorrect-decimal-places/m-p/293923#M61280</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-25T03:15:45Z</dc:date>
    </item>
  </channel>
</rss>

