I'm not sure UNSTRING is a good choice here. Your sample input has two delimiters -- space and period. What other delimiters are allowed -- such as comma, semicolon, colon, question mark, exclamation point? Your program should find the next delimiter, get the word from the input variable into a holding variable, and then look at the word array to see if you've already got that word in the array. If not, add it to the array (you'll need to track how many entries you have in your word array), then go find the next delimiter. If I were doing this, I'd probably make a copy of the input and make the copy all lower case so capitalization doesn't cause any issues (your sample has My and my but they are counted together even though they aren't the same in EBCDIC).