|
cpwong wrote:
>
> Hi friends,
> Is there any SAS function that return the number of words in a string ?
> Many thanks.
> cpwong
Nope. You'll have to code it by hand.
data _null_;
str="aa bb cc dd ee ff";
i=1;
do until(scan(str,i," ")=' ');
i=i+1;
end;
words=i-1;
put words=;
run;
Roland
|