cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
jan_solo
Level III

Check if a column has numeric data

Hi everyone,

I loop over columns in a table collected from the DB.  Some of them have no data in them (leading to empty charts).  Is there a way to check if a column has numeric values?

thx guys,

Jan

1 ACCEPTED SOLUTION

Accepted Solutions
jan_solo
Level III

Re: Check if a column has numeric data

Thank you,

It seems that my version of JMP (11.1.1 x64) doesn't recognize the Anydigit function, however your answer led straigth to my answer:

ColMinValue = Col Minimum( :MyColumn );

Is Missing(ColMinValue) -> true if there is no value for ColMinValue.

Thx!!!

Jan

View solution in original post

2 REPLIES 2
rw9
rw9
Level I

Re: Check if a column has numeric data

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;

jan_solo
Level III

Re: Check if a column has numeric data

Thank you,

It seems that my version of JMP (11.1.1 x64) doesn't recognize the Anydigit function, however your answer led straigth to my answer:

ColMinValue = Col Minimum( :MyColumn );

Is Missing(ColMinValue) -> true if there is no value for ColMinValue.

Thx!!!

Jan

Recommended Articles