- data have;
- input col1 $ 1-8 col2 $ 10-17 ;
- cards;
- ASAD1234 BBBB6789
- J23DD790 1L561WQE
- ??xxxbcd _?*djffs
- 12334ddd &djd>ccc
- ;
- run;
- data want;
- set have;
- array str(2) col1-col2 ;
- array new(2) $8 new1-new2 ;
- do i=1 to 2;
- if prxmatch("/\w{8}?/",str(i)) and not index(str(i),"_") then new(i)=str(i);
- end;
- run;