Thanks for your answer. This was the hint I needed. Now it make sence. I want to keep the space between the word, but I have to loop / process each letter. So the final solution is this: data want (drop=c i ablank);
length string_in string_out $50 c $1;
string_in = "this is a textstring";
ablank=0;
do i = 1 to lengthc(string_in);
c = substr(string_in,i,1);
if ablank=1 then string_out = cat(strip(string_out)," ",c);
else string_out = cat(strip(string_out),c);
if c=" " then ablank=1;
else ablank=0;
end;
run;
... View more