Hi, I have written a code in base sas to extract all the words in a string/paragraph. I want to create a macro for it. But I failed. Requesting help. Thanks Below are the Codes which is successfully running and the macro code which is not. Please advise. =======running========================================= data test; i = 1; word = 'I am using scan and index function in sas together and I got successful'; do while (find(word,scan(word,i),'t')>0); w = scan(word,i); output; i+1; end; keep w i; run; =============================================== ==========Error============================== %macro wordparsin(word); data test; i = 1; /* word = 'I am using scan and index function in sas together and I got successful'; */ %do %while (%find(&word,%scan(&word,i),'t')>0); w = %scan(&word,i); output; i+1; %end; keep w i; run; %mend; %wordparsin(I am using scan and index function in sas together); ========================================
... View more