/* -------------------- rexx procedure -------------------- * * Name: WordNum * * * * Function: Determine the number (numerology) for a * * given word or string * * * * Syntax: %wordnum word(s) * * * * Note: blanks and case are ignored * * * * Author: Lionel B. Dyck * * Kaiser Permanente Information Technology * * Walnut Creek, CA 94598 * * (925) 926-5332 * * Internet: lbdyck@gmail.com * * * * Sample Results: Management is 93 * * Hardwork is 98 * * Attitude is 100 * * * * History: * * 03/12/04 - Creation * * * * ---------------------------------------------------------- */ parse arg words if length(words) = 0 then do say "Error. The use of this command requires that you enter" say " a word or phrase to receive the numeric count." exit 16 end wordu = translate(words) str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" count = 0 do i = 1 to length(wordu) c = substr(wordu,i,1) if datatype(c) = "NUM" then count = count + c else do c = pos(c,str) count = count + c end end say "Count for word" words "is" count