@RW9 wrote: Something like: data want;
set have;
if lengthn(pc)=6 then do;
...
end;
else do;
...
end;
run; You may not need the do blocks, thats just for illustration. To note, its sometimes better to code little bit each time, so break off part one and part two then combine in another step - just makes reading the code much simpler e.g.: data want (drop=last first);
set have;
last=substr(pc,lengthn(pc)-2);
first=substr(pc,1,lengthn(pc)-3);
want=catx(' ',first,last);
run; thank you very much for your help and explanation. Regards Nandeep
... View more