Hi, Just want to chime in here and say that writing to a temporary file is not necessary. You can utilize call execute to do exactly the same thing, using your rules dataset as the loop, and a proc sql insert statement to insert fallouts into a master table. (Pinching your test data Tom, hope you don't mind): data rules ; infile cards dsd dlm='|'; length exceptioncode $10 exceptiongrade $1 exceptionage $20 ; length client $20 rule $1000 ; input exceptioncode -- rule ; cards; 3535asdf|B|12 Months|Brandon|balance > 100 and loantype="purchase" and age<50 3535asdf|B|12 Months|Enron|balance > 580 and loantype="purchase" and age<50 and producttype='test type' run; proc sql; create table EXCEPTIONS ( EXCEPTION_CODE char(200), NAME char(200) ); quit; data _null_; set rules; call execute('proc sql; insert into EXCEPTIONS select "'||strip(exceptioncode)||'", NAME from YOUR_DB_DATA where '||strip(exceptionrule)'; quit;'); run; Its pretty much how OC does things, except there it is a cursor, here its a dataset. So the rules are passed into the dataset. The call execute generates the sql code including the rule, that is run after the datastep completes.
... View more