Hi, similarly (in some way) to what Anotherdream suggested, here is what I thought of: data in; length string $50.; string = " 18995|Pend-PrSu|18000_ProdSupReg|I|00102||||"; *remove the letters and other funny characters; temp_string = prxchange("s/[a-zA-Z|-]//", -1, string); *get the first 5 digits; string_first_5 = substr(temp_string, 1, 6); *get the last 5 digits; string_last_5 = translate(reverse(substr(reverse(trim(temp_string)), 1, 6)), "", "_"); run; proc print data = in;run;
... View more