Hi,
Anydigit(string), is 0 if doesn't contain digits, 1 if it does.
If you want to check if they are convertible to number then do:
if anyalpha(string)=0 then no upper or lower characters so assume number.
If you have special characters then compress them out.
E.g.:
data have;
attrib my_string format=$20.;
my_string="12345"; output;
my_string="-12345"; output;
my_string="ABC12345"; output;
run;
data want;
set have;
attrib my_num_var format=best.;
have_any_digit=anydigit(my_string);
have_convertible=anyalpha(compress(my_string,"-+."));
if have_convertible=0 then my_num_var=input(my_string,best.);
run;