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;
Please provide us with a 5-line data example of the before and after tables.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.