/ Published in: SAS
URL: http://jaredprins.squarespace.com/blog/2008/3/31/sas-word-count-program.html
Expand |
Embed | Plain Text
%macro nwords(s); (compress(&s) ne ' ') * (length(left(compbl(&s)))-length(compress(&s))+1) %mend nwords; data _null_; string = "dasj h 07y lk0 - ldsmv"; nwords = %nwords(string); put nwords=; run; /*NWORDS=6*/
You need to login to post a comment.
