say a Variable has ws-name pic X(10)
and the text as "radi"

declare another variable with pic 9(2) or something
say ws-count pic 9(2)

then

INSPECT WS-NAME TALLYING WS-COUNT FOR CHRACTERS...