I keep getting this error when I try to use a hash table: ERROR: Duplicate key. I have other tables that run fine, so presumably the code is fine, but this particular table will not work. I have done a proc sort nodupkey on exactly the same keys I am using and there are no duplicates in the table at all. So I don't understand why it says this particular table has a duplicate key. This is the code: data workjw.base2; set workjw.base; if _n_ = 0 then do; set workjw.acct_tpe_bin; end; if _n_ = 1 then do; declare hash b(dataset: "workjw.acct_tpe_bin", duplicate: "r"); rc2=b.definekey("CH_ACCT_NO_BIN", "ACCT_TPE_CDE"); rc2=b.definedata("ACC_DESC_BIN"); rc2=b.definedone(); b.add(); end; rc2=b.find(); if rc2 ne 0 then do; ACC_DESC_BIN=""; end; run;
... View more