04-27-2016 09:55 PM
04-27-2016 02:57 PM
It depends on what you mean by a row being updated.
update master trans (in=in_trans);
updated = in_trans;
The variable UPDATED tells you whether a record was found in the transaction file for that ID. However, it doesn't tell you whether the data values actually changed the contents of the MASTER data set. It would still be possible that all data values in TRANS had missing values and were ignored, or that the values in TRANS matched what was already in MASTER.
04-27-2016 03:11 PM
In that case, there is no system tool. You would have to run a PROC COMPARE after the fact (with a BY statement), to find differences between the original and the new data set.
04-27-2016 05:18 PM
What I'm seeking are two things 1) were any records appended (new records) and 2) were any variable values changed
Then something like this
data health2; update health (in=a) fitness(in=b); by id name team; Updated = b; If a and b then Updated=1; If not(a) and b then New=1; run;
Though the example data I posted below didn't have any new records as that wasn't what your intial post implied.
04-27-2016 03:05 PM
No automatic variable that I am aware of but here is code that shows one way of adding your own as part of an update.
Note that the first bits are just to provide example data the last datastep has one technique.
Data HEALTH ; input ID NAME $ TEAM $ WEIGHT ; datalines; 1114 sally blue 125 1441 sue green 145 1750 joey red 189 1994 mark yellow 165 2304 joe red 170 ; run; Data FITNESS ; input ID NAME $ TEAM $ WEIGHT; datalines; 1114 sally blue 119 1994 mark yellow 174 2304 joe red 170 ; run; proc sort data=health; by id name team; run; proc sort data=fitness; by id name team; run; /* Update Master with Transaction */ data health2; update health fitness(in=b); by id name team; Updated = b; run;
04-27-2016 09:55 PM
Need further help from the community? Please ask a new question.