Hello,
I would like to find the last digit after the decimal place of the non-integer variable in SAS 9.4.
e.g. I would like the last digit of 1.48 to show up as 8
-
infile datalines flowover;
input cohort id t1_trial1 t1_trial2 t1_trial3 t2_trial1 t2_trial2 t2_trial3;
datalines;
1 30 1.6054 1.48 1.675 1.88 1.905 2.015
1 31 2.235 1.605 1.64 1.81 1.815 1.855
1 32 3.87 3.075 3.06 3.295 3.18 3.155
1 55 2.76 2.535 2.97 2.76 2.7 3.275
1 56 3.945 3.075 3.065 5.835 4.89 4.5459
1 67 2.05 1.945 1.56 3.015 3.005 3.135
1 76 1.65 2.165 1.87 2.99 2.22 2.5
;;;;
proc print; run;
/*I tried the following but no success */
data test2;
set test;
array l1 t1_trial1 - t1_trial3;
array l2 t2_trial1 - t2_trial3;
do over;
last1 = substr(l1, 1, length(l1)-1);
last2 = substr(l2, 1,length(l2)-1);
end;
run;
Would appreciate some help!
Margaret