Rather than using convoluted techniques to count the occurences of a word in a String…One can use the COUNT() function in SAS9 to get the results…
data _null_ ; |
sentence= 'Are you sure You are working to Learn SAS' ; |
num=count(sentence, 'are','i') ; |
put num= ; |
run ; |
The results here is 2 …u guessed it right !!!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.