Fun with parsing strings in SAS
Friday, May 16, 2008
Jared in SAS

The goal of this code is to parse the first 5 letters of the variable and append it to the last 7 digits of the variable.

data _null_;
  length id2 $12;
  id = 'LOLOBRIDGIDA195703F';
  id2 = substr(id,1,5)||reverse((substr(reverse(id),1,7)));
  put _all_;
run;

View the code in my snippet repository.

Kudos to the guys in the SAS google group thread for this solution. 

Article originally appeared on jaredprins (http://jaredprins.squarespace.com/).
See website for complete article licensing information.