@Patrick wrote:
Your column CT_value is likely still of type numeric (Proc Contents would tell you). The value 4.00000000001E-3 is likely just scientific display of a numerical value.
I'm rather sure that it is character because the values appear to be left-aligned in the Viewtable and also "4.0000000000000001E-3" (15 zeros) is impossible as a value of a numeric variable in SAS (under Windows). The same holds for "7.0000000000000007E-2" in NT_value.
While 4.0000000000000001E-3 means 0.004 + 1E-19 mathematically, the least significant bit in the internal representation of 0.004 has a place value of 2**-60=8.67...E-19. So, those 1E-19 (and even 4E-19, still less than half that place value) are rounded off, which means that an import as a numeric value should result in the clean value 0.004 automatically.
It's a bit surprising, though, that the numeric literal 7.0000000000000007E-2 (mathematically: 0.07+7E-18) in SAS is equal to 0.07 (on my Windows workstation, regardless of the DECIMALCONV system option setting) and not rounded up, although 7E-18 is greater than half the place value 2**-56=1.38...E-17 of the least significant bit. However, SAS correctly rounds the sum 0.07+7E-18 up and the sum 0.07+6E-18 down.
Your example 4.00000000001E-3 (0.004+1E-14) and the number 4.00000000000001E-3 (0.004+1E-17) mentioned by the OP are far enough apart from 0.004 so that, as you rightly suggest, explicit rounding would be required to obtain 0.004.
... View more