Date: Fri, 28 Oct 2005 16:05:57 +0300
Reply-To: Nina Harris <sas@MAILINATOR.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nina Harris <sas@MAILINATOR.COM>
Subject: Re: Counting Words in a Text String
Content-Type: text/plain; charset="Windows-1252"
here's a variation
%macro nwords ( s ) ;
((length (compbl(left(&s))) - length (compress(left(&s))) + 1)
* (&s ne ''))
%mend nwords ;
data _null_;
nwords = %nwords ("was used function-style as");
put _all_;run;
|