Count up the number of substrings in a string


/ Published in: SAS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. data _null_ ;
  2.  
  3. long='a b c d a e d a e t g d a c s' ;
  4.  
  5. num_a=countc(long,'a') ;
  6.  
  7. put num_a= ;
  8.  
  9. run ;

URL: http://jaredprins.squarespace.com/blog/2008/10/7/some-sas-code-snippets.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.