This is a partial code of the one I am working on. the purpose is to change "-0.0" or "-0" to "0". I used "case" to create a new variable "New_min" and apply it to the next new variable "m". but I failed, can anyone tell me how to do it ? Thanks. The SAS version I am working on is 9.4.
proc sql noprint;
create table data2 as
select avisitn,
case
when abs(var_min) le 0.0000001 or var_min = -0 then 0
when var_min = . then .
else strip(put( var_min, 10.2 )) end as new_min,
strip(put(round(new_min,0.01),best.))||', '|| strip(put(round(_max,0.01),best.)) end as m
from data1;
quit;
Thank you very much! it works.
You could simplify to:
proc sql;
create table data2 as
select
avisitn,
catx(", ", put(fuzz(var_min), 10.2), put(_max, 10.2)) as m
from data1;
quit;
Thank you!
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 lock in 2025 pricing—just $495!
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.