I am using the following transaction table to update the master table. What I have observed is that when the transaction table is small the update happens smoothly. When the size increases the code fails with an ORA-01403 error. It doesnt make any sense to me as it does not seem logical. Any help or direction will be great.
data temp(index=(comp=(card_number cell_package_sk)));
set import_data;
keep card_number cell_package_sk SMS_STATUS SMS_SENT_DT LastUpdate;
run;
data master (drop=new_status new_date1 new_date2);
set temp(rename=(SMS_STATUS= new_status SMS_SENT_DT=new_date1 LastUpdate=new_date2) in=a) key=comp / unique;
modify master;
select (_iorc_);
when (%sysrc(_sok)) do;
if a then do;
if upcase(new_status) = "DELRD" then SMS_STATUS = "DELIVERED";
ELSE if upcase(new_status) = "DND" then SMS_STATUS = "NDNC";
ELSE if upcase(new_status) = "NO-DLR" then SMS_STATUS = "UNKNOWN";
ELSE SMS_STATUS = "FAILED";
SMS_SENT_DT = new_date1;
SMS_DELIVERED_DT = new_date2;
replace;
end;
else do;
_error_ = 0;
end;
end;
otherwise do;
_ERROR_ = 0;
end;
end;
run;
ERROR: Update/delete failed. The observation may have been changed or deleted since the time it was read. ORACLE execute error: ORA-01403: no data found.
Note that Master is oracle table while temp is a SAS data set. The master table has around 45 million records and transaction has 500 thousand.