How to set the precision on a SAS numeric value

Victor

I have this data set with 2 numeric values, these values are calculated by different systems with different precision parameters. So they round differently.

data test;
a = 10;
b= 11;
run;

Basically a and b started out as an almost same float value but due to rounding difference, ended up having a different value. I need a proc sql which treats values like these as same (i,e. precision of (+/- 1);

So I need this to return true;

proc sql;
select * from test where a = b;
quit;
Robert Penridge

This is ugly, and assumes you are saying that anything within the range of a single integer should be treated as the same value, then you could do something like:

where max(a,b) - min(a,b) le 1;

This assumes that there are no missing values. If you have missing values you can use something like:

where max(sum(0,a),sum(0,b)) - min(sum(0,a),sum(0,b)) le 1;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SAS : how to test if a variable is numeric

From Dev

How To select All Rows from a SAS data set that Match at least one value in another SAS Data set

From Dev

How to set the selection of a combobox from a numeric value to a named color

From Dev

How to set precision without rounding?

From Dev

Clojure - How to set the lower precision

From Dev

how to read 12 digit numeric in sas

From Dev

How to get the exact type of numeric columns incl. scale and precision?

From Dev

PostgreSQL - change precision of numeric?

From Dev

SAS; how to update a data set

From Dev

How to set precision and scale in ALTER TABLE

From Dev

How to properly set precision for doubles in C++

From Dev

How to set precision and scale in ALTER TABLE

From Dev

How to set specific precision to BigDecimal in Java?

From Dev

How to check if a numeric value is an integer?

From Dev

How to code not continuous numeric value

From Dev

How to sort numeric value in file

From Dev

How to sort according to value in SAS?

From Dev

How to select specific value in sas

From Java

How to concatenate string and numeric SAS Macro and use it in where statement

From Dev

How to create a Numeric format from a character strings in SAS?

From Dev

How to change from character to numeric of many variables at a time in SAS?

From Dev

SAS How to name file with Macro Numeric and String concatenated?

From Dev

How to convert numeric value in English to Marathi numeric value in C#?

From Dev

SAS - Size Char and Numeric

From Dev

Length of numeric values in SAS

From Dev

SAS numeric to character conversion?

From Dev

Length of numeric values in SAS

From Dev

How to check whether a value is a numeric value in Prolog?

From Dev

What is the maximum value / precision that can be stored a sorted set in redis

Related Related

  1. 1

    SAS : how to test if a variable is numeric

  2. 2

    How To select All Rows from a SAS data set that Match at least one value in another SAS Data set

  3. 3

    How to set the selection of a combobox from a numeric value to a named color

  4. 4

    How to set precision without rounding?

  5. 5

    Clojure - How to set the lower precision

  6. 6

    how to read 12 digit numeric in sas

  7. 7

    How to get the exact type of numeric columns incl. scale and precision?

  8. 8

    PostgreSQL - change precision of numeric?

  9. 9

    SAS; how to update a data set

  10. 10

    How to set precision and scale in ALTER TABLE

  11. 11

    How to properly set precision for doubles in C++

  12. 12

    How to set precision and scale in ALTER TABLE

  13. 13

    How to set specific precision to BigDecimal in Java?

  14. 14

    How to check if a numeric value is an integer?

  15. 15

    How to code not continuous numeric value

  16. 16

    How to sort numeric value in file

  17. 17

    How to sort according to value in SAS?

  18. 18

    How to select specific value in sas

  19. 19

    How to concatenate string and numeric SAS Macro and use it in where statement

  20. 20

    How to create a Numeric format from a character strings in SAS?

  21. 21

    How to change from character to numeric of many variables at a time in SAS?

  22. 22

    SAS How to name file with Macro Numeric and String concatenated?

  23. 23

    How to convert numeric value in English to Marathi numeric value in C#?

  24. 24

    SAS - Size Char and Numeric

  25. 25

    Length of numeric values in SAS

  26. 26

    SAS numeric to character conversion?

  27. 27

    Length of numeric values in SAS

  28. 28

    How to check whether a value is a numeric value in Prolog?

  29. 29

    What is the maximum value / precision that can be stored a sorted set in redis

HotTag

Archive