Hi. It's good to know the variable type before using functions. But if you don't care, you could use a CAT function with that INPUT function and SAS would give the same result whether the variable is CHAR or NUM ...
data _null_;
format num char 10.2;
retain x '12345' y 12345;
char = input(cat(x),5.);
num = input(cat(y),5.);
put x= char= / y= num=;
run;
the LOG .(no "nasty" messages) ...
191 data _null_;
192 format num char 10.2;
193 retain x '12345' y 12345;
194 char = input(cat(x),5.);
195 num = input(cat(y),5.);
196 put x= char= / y= num=;
197 run;
x=12345 char=12345.00
y=12345 num=12345.00