I like @Tom's solution to the problem as you presented it. His response is a nice demonstration of the usefulness of the SUPERQ macro function.
But why use a semi-colon as a group delimiter in the first place? Yes, you can make two lists as @ballardw suggested, but you could also chose a delimiter like !, as in
%let string = a,123!b,321!c,456!d,789!e,888;
This would allow you to drop the %STR usage, and the rest of your code logic would need no changes except for specifying ! as the group delimiter. Just choose a delimiter that you know will not be part of the string value, and does not need masking by %STR.
... View more