@Peter Thanks for the link,
I had a look at the link before starting the topic, but I think the modifiers for SCAN function applies for latest release of SAS :S ..
We have SAS 9.1 and when I use the modifiers for the scan function it says,
ERROR 72-185: The COUNTW function call has too many arguments.
8 do count = 1 to nwords;
9 word = scan(string, count, delim, modif);
ERROR 72-185: The SCAN function call has too many arguments.
For the program,
keep count word;
length word $30;
string = ',leading, trailing,and multiple,,delimiters,,';
delim = ',';
modif = 'mo';
nwords = countw(string, delim, modif);
do count = 1 to nwords;
word = scan(string, count, delim, modif);