To filter records where accountkey is missing is easy, but I need to know which table holds this variable. Let's say its origin is the B table, then the full code will be: proc sql; create table Payments as select a.*, b.* from work.DateKey(where=(date>'28Aug2016'd)) as A left join DWH.vwFactSalaryTransactions(where=(account_key ne .)) as B on (a.Datekey = b.Datekey) ; quit; if accountkey is in the lookup table (A) then: proc sql; create table Payments as select a.*, b.* from work.DateKey(where=(date>'28Aug2016'd and account_key ne .)) as A left join DWH.vwFactSalaryTransactions as B on (a.Datekey = b.Datekey) ; quit;
... View more