Dear community,
I have a super simple question but could not figure out by my own, see below codes. Why I cannot get any record in data set "test"? This is so weird.
data A;
do v_gamma=0.7668,1,1.5,2,2.5,3,3.2749;
do v_rho=0 to 1 by 0.1;
do v_deltap=2,3,4,5;
do v_deltas=1,2,3,4,5;
v_tp1=0.5;
v_ts1=0.5;
v_alpha=0.05;
v_eps=1E-11;
output;
end;
end;
end;
end;
run;
data test;
set A;
where v_rho=0.8;
run;
see this paper:
and try this:
data test;
set A;
where round(v_rho,0.1)=0.8;
run;
see this paper:
and try this:
data test;
set A;
where round(v_rho,0.1)=0.8;
run;
You can make it work using
data test;
set A;
where round(v_rho,0.1)=0.8;
run;
The issue is related to rounding and the way computers internally store numeric values, specifically floating points.
See this thread for more info: Solved: Re: I meet with a problem of data values in do loo... - SAS Support Communities
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.