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 (September 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 11 Sep 1997 10:30:26 EDT
Reply-To:   "Mr. Juggie Mistry CUUKMAIL MS - 22702/27411" <juggie_mistry@UK.CU.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Mr. Juggie Mistry CUUKMAIL MS - 22702/27411" <juggie_mistry@UK.CU.COM>
Subject:   REF: RE: FUNCTION TO COUNT WORDS....
Content-Type:   text/plain; charset=US-ASCII

/*==================================================================== ! ! ! Name : M_WC.SAS ! ! Type : Base SAS Macro ! ! Date : 29th April 1997 ! ! ! ! Purpose : Counts number of words in a string ! ! ! ! Author : Jugdish Mistry-Professional Solution Providers Ltd.! ! Version : 1.0 ! ! ! ! Run mode : Interactive ! ! Passed in : None ! ! Passed out : None ! ! ! ! Maintanance History ! ! ! ! When Who What ! ! ! ====================================================================*/

%macro wc(string); %let word=%scan(&string,1); %let wc=0; %do %while(%quote(&word) ne %quote()); %let wc=%eval(&wc+1); %let word=%scan(&string,&wc); %end;

&wc; %mend;

/* e.g. data _null_; x = %wc(once upon a time); put x=; run; */

Hope this helps Juggie.

Juggie Mistry SAS consultant I12


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