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!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.