Leonid, once again a disclaimer - I don't have the code handy, and I hope nothing has been lost trying to cut it down to the essentials.

data outtable;
if _n_ eq 1 then do; /* set up hash table */
declare hash lookup(dataset:'work.tbl2');
dts.DefineKey('keyvar1','keyvar2');
dts.DefineData('othvar1','othvar2','othvar3','othvar4');
dts.DefineDone();
call missing(keyvar1,keyvar2, othvar1,othvar2,othvar3,othvar4);
end; /* of set up hash table */
***;
set intable;
by byvar;
do i=1 to 50 until word eq '';
word = scan(InpLine,i);
if word ne '' then do;
rc = lookup.find(KEY: byvar, KEY:word);
if (rc = 0) then do; /* word found in lookup */
/* some processing of InpLine from intable and using the other vars */
end; /* of word found in lookup */
end; /* of word not blank */
end; /* of scan loop */
run;

As can be seen, I devised it to solve a 'parsing' type of problem. One issue being whether to search the InpLine for each of the keywords applicable to the byvar (varied between 3 to over 270 ! ), or to check whether any word from InpLine was an applicable keyword.