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 06:11:04 -0700
Reply-To:     chris@OVIEW.CO.UK
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         chris@OVIEW.CO.UK
Organization: http://groups.google.com
Subject:      Re: Counting Words in a Text String
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

Heh heh. I read this thread thinking "not that old chestnut again", only to find that not only was it the same old chestnut, but Richard has quoted my first response to the question from nine years ago!

By the way, you can handle the null string case and still do it on one line:

numwords = (string ne " ") * (1 + length(compbl(string)) - length(compress(string)));

Chris. -------------------------------------------------------- Elvis SAS Log Analyser - http://www.oview.co.uk/elvis --------------------------------------------------------


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