data a;/*求助*,怎么样把*第四个观测的第二个号码串输出来*/
input string $ 50.;
cards;
THIS LINE DOES NOT HAVE ANY PHONE NUMBERS ON IT
THIS LINE DOES: (123)345-4567 LA DI LA DI LA
ALSO VALID (123) 999-9999
TWO NUMBERS HERE (333)444-5555 AND (800)123-4567
;
run;
data b;
set a;
per=prxparse("/\(\d{3}\) ?\d{3}-\d{4}/");
retain per;
if prxmatch(per,string) then do;
call prxsubstr(per,string,start,length);
b=substr(string,start,length);
b=compress(b," ");
output;
end;
run;