*
;
/*
Newsgroups:   bit.listserv.sas-l
Date:         Mon, 12 Jun 1995 16:29:22 MET
Sender: "SAS(r) Discussion" 
From: "Wim A.J.G. Lemmens" 

Subject:      Brief summary/answer on : Number of chars in a given string
To: Multiple recipients of list SAS-L

Dear SAS-LŽers / dear responders,

Thank you all for your time spending on my problem.
All solutions where based on using a combination of :
the sas-functions : Compress - Index - Length - Substr - Tranwrd - Trim .
Below is given the macro I'll use in my specific problem.

***********especially the following persons :(sorted on location)

           adamhndrx @ aol.com
           Raymond K. Lee 
           gibes @ nutra.monsanto.com
           Jugdish @ pspltd.demon.co.uk (Jugdish K. Mistry)
           whitloi1 @ westatpo.westat.com
           "Zack, Matthew M." 
           dstanle @ IBM.NET
           Ron Meisenheimer 
           CVRGING @ TECHNION
           "Richard A. DeVenezia" 
************
Greetings from :
  Wim (W.A.J.G.) Lemmens, Statistical Analyst/Programmer
* University of Nijmegen, Faculty of Medical Sciences ------------------*
* Department of Medical Informatics, Epidemiology and Statistics        *
*                                  SAS-version :       6.08  VM/CMS/ESA *
* 151-MSA-                         Phone       :       (31) -80- 617678 *
* P.O.Box 9101                     Fax         :       (31) -80- 613505 *
* NL-6500 HB Nijmegen              E-mail    -1-  U439002@vm.uci.kun.nl *
* The Netherlands                            -2-   W.Lemmens@mie.kun.nl *
*-----------------------------------------------------------------------*
*    >>> visiting address : Kapittelweg 54  6525 EP Nijmegen <<<        *
*-----------------------------------------------------------------------*
*/


%macro strcnt(str=,sub=,nsub=);
** STR : the complete string in which the characters are;
** SUB : the character-substring to be found;
**NSUB : the number of times the specified SUB is found;
 &nsub= (   length(&str) -
            length( compress( tranwrd( &str, trim( &sub )," " )," " ) )
        ) / length(&sub);
%mend;

*
;