BookmarkSubscribeRSS Feed
David_Billa
Rhodochrosite | Level 12

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;

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Please provide us with a 5-line data example of the before and after tables.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 686 views
  • 0 likes
  • 2 in conversation