LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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;


Back to: Top of message | Previous page | Main SAS-L page