I'm working with qualitative data, where a variable COMMENT represents a string of text written in by a study participant. Some comments aren't in full sentences, but some have several sentences.
I've figured out how to split the string at any period it finds into a separate row & retain an ID value for that (so I can manually match up the comment "pieces" to the original full comment if needed):
do i=1 by 1 while(scan(COMMENT,i,'.')^=' ');
new=scan(COMMENT,i,'.');
retain ID;
output;
end;
While looking through my first run of this code, I realized there is a problem: some comments will include things like "Mr." or a decimal like "12.1".
What's the easiest way to add a layer to this code that will split the string only at the end of an actual sentence (delimited by a period)?