We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Ballyhoo


Posted By

webonomic on 03/31/08


Tagged

count word


Versions (?)


Word Count 2


Published in: SAS 


URL: http://jaredprins.squarespace.com/blog/2008/3/31/sas-word-count-program.html

  1. %macro nwords(s);
  2. (compress(&s) ne ' ') *
  3. (length(left(compbl(&s)))-length(compress(&s))+1)
  4. %mend nwords;
  5.  
  6. data _null_;
  7. string = "dasj h 07y lk0 - ldsmv";
  8. nwords = %nwords(string);
  9. put nwords=;
  10. run;
  11.  
  12. /*NWORDS=6*/

Report this snippet 

You need to login to post a comment.