<?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 Comparing Values with different informats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315248#M68721</link>
    <description>&lt;P&gt;Here is a snapshot of some original data (the dataset is much larger)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6098i35892E24A4E9470F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmountOGValues.PNG" title="PayAmountOGValues.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snapshot of the proc contents for this dataset (side question- how can DOLLAR16.2 be an informat?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6099i32A2448BB2AED52A/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmount.PNG" title="PayAmount.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing this work in EG, and what I'm trying to attempt to do either in a program or query builder is compare the values of ApprovedMemberPay and ApprovePatientPayAmount and return rows where they don't match, so when I try comparing them right off the bat without doing anything to the variables but simply using the condition "where ApprovedPatientPayAmount ne ApprovedMemberPay" I get a dataset showing the same values (below), which is the opposite of what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6101iE1167F1BE0A61C18/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmountResults.PNG" title="PayAmountResults.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I change formats/informats to compare the two values correctly?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2016 16:55:22 GMT</pubDate>
    <dc:creator>JediApprentice</dc:creator>
    <dc:date>2016-11-29T16:55:22Z</dc:date>
    <item>
      <title>Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315248#M68721</link>
      <description>&lt;P&gt;Here is a snapshot of some original data (the dataset is much larger)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6098i35892E24A4E9470F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmountOGValues.PNG" title="PayAmountOGValues.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snapshot of the proc contents for this dataset (side question- how can DOLLAR16.2 be an informat?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6099i32A2448BB2AED52A/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmount.PNG" title="PayAmount.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing this work in EG, and what I'm trying to attempt to do either in a program or query builder is compare the values of ApprovedMemberPay and ApprovePatientPayAmount and return rows where they don't match, so when I try comparing them right off the bat without doing anything to the variables but simply using the condition "where ApprovedPatientPayAmount ne ApprovedMemberPay" I get a dataset showing the same values (below), which is the opposite of what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6101iE1167F1BE0A61C18/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="PayAmountResults.PNG" title="PayAmountResults.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I change formats/informats to compare the two values correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 16:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315248#M68721</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-11-29T16:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315258#M68725</link>
      <description>&lt;P&gt;Most likely, you are already comparing the values correctly.&amp;nbsp; But the report doesn't illustrate that because of the formats.&amp;nbsp; It seems likely that the variables are different somewhere beyond the second digit after the decimal point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To test that, remove the format in the new data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;where ApprovedPatientPayAmount ne ApprovedMemberPay;&lt;/P&gt;
&lt;P&gt;format ApprovedPatientPayAmount&amp;nbsp; ApprovedMemberPay;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By removing the formats, you will be able to see the actual values instead of the formatted values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315258#M68725</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-29T17:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315259#M68726</link>
      <description>&lt;P&gt;You can just remove the informats and formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg.&lt;/P&gt;
&lt;P&gt;informat ApprovedMemberPay;&lt;/P&gt;
&lt;P&gt;format ApprovedMemberPay;&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;</description>
      <pubDate>Tue, 29 Nov 2016 17:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315259#M68726</guid>
      <dc:creator>evp000</dc:creator>
      <dc:date>2016-11-29T17:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315277#M68731</link>
      <description>&lt;P&gt;This is the code I used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set data;
  where ApprovedMemberPay ne ApprovedPatientPayAmount;
  format ApprovedMemberPay ApprovedPatientPayAmount;
  informat ApprovedMemberPay ApprovedPatientPayAmount;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I'm still getting results with same values (besides the ones that are 0):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6106iEBE254E99623AAB0/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="AppResults.PNG" title="AppResults.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315277#M68731</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-11-29T17:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315282#M68733</link>
      <description>&lt;P&gt;Try adding another variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;difference = ApprovedMemberPay - approvedPatientPayAmount;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect the values will be tiny, like 1E-15.&amp;nbsp; If that turns out to be true, it will be helpful information for you to decide on the next step.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315282#M68733</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-11-29T17:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315288#M68735</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;&amp;nbsp;You're right, they turned out to be very small values; 8.88E-16, -5.32E-15...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315288#M68735</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-11-29T17:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values with different informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315295#M68739</link>
      <description>&lt;P&gt;Use the round() function to discard the small fractional values. These tiny values are artifacts of the way SAS stores and computes numerical values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Values-with-different-informats/m-p/315295#M68739</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-29T17:55:32Z</dc:date>
    </item>
  </channel>
</rss>

