data test;
if total = -0 then R=0;
run;
This did not convert -0 to 0;
I tried this also
data test;
if total = 0 then R = abs(val0);
run;
Do you really have values that are –0?? I have never seen them. Why bother converting them, anyway?
But your code is off the mark.
How about this untested code:
data test;
set test;
if total= -0 then total=0;
run;
Paige Miller wrote:
Do you really have values that are –0?? I have never seen them. Why bother converting them, anyway?
But your code is off the mark.
How about this untested code:
data test;
set test;
if total= -0 then total=0;
run;
It's has to do with w.d format. I don't know if it is intentional or not but very small negative print as -0.
It's showing as -0, but is probably -0.000009 or something like that.
Try a round function or a floor or ceiling instead depending on what will work based on your other data points.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.