data a;
input x @@;
cards;
1 2 23 99 199 1999 19999
;
run;
data b;
set a;
length y $6.;
if 0<x<10 then y=cat("00000",x);else if 0<x<100 then y=cat("0000",x);else if 0<x<1000 then y=cat("000",x);
else if 0<x<10000 then y=cat("00",x);else if 0<x<100000 then y=cat("0",x);
run;
data q;
input x @@;
cards;
9.2 9.01 -4.15 8.02 188
;
run;
data aa;
set q;
z=x-int(x);
i=reverse(x);
u=substr(i,1,1);
run;
data test1;
input x @@;
cards;
1 23 234 4567
;
run;
data q1;
format x z6.;
set test1;
run;
data test2;
input x @@;
format x 4.2;
cards;
9.01 8.02 9.1 188
;
run;
data q23;
set test2;
format z z2.;
z=scan(x,2,'.');
if z<0 then z=0;
else z=scan(x,2,'.');
u=substr(z,2);
run;