I need a help to know to update one field based on the subtraction of two variables from other datasets. Code which I use is shown below.
Here I want to update error_count value and it should subtract table_count_hub value from table_count value from run_id_received dataset
.
proc sql noprint;
create table run_id_received as
select run_id,table_count,table_count_hub,error_count
from status;
proc sql;
update main.status
set table_count_hub =(select table_count_hub from run_id_received),
error_count =??? /*I want to subtract table_count_hub value from table_count value from run_id_received dataset*/
;
quit;