程序:b=countc(a,'2');
语法:COUNTC(string, charlist <,modifiers>)
和count函数的比较:The COUNTC function counts individual characters in a character string, whereas the COUNT function counts substrings of characters in a character string.
详情参考:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002260840.htm