Desktop productivity for business analysts and programmers

finding numeric values in a character string

Reply
Not applicable
Posts: 0

finding numeric values in a character string

Hi,

A='A1B2N3M4L5';

THE OUTPUT SHOULD BE =12345


I have variable A which contains a string. how can i get numeric values from that string.?
SAS Employee
Posts: 183

Re: finding numeric values in a character string

Posted in reply to deleted_user
b=compress(x,'0123456789','k');
or
b=compress(x,'dk');
Ask a Question
Discussion stats
  • 1 reply
  • 119 views
  • 0 likes
  • 2 in conversation