I have two similar datasets generated on different days.
First Dataset attached called:
Have generated on 03NOV2020
data have ;
format date_1 date9. ;
input id $ sp_num $ type $ date_1 yymmdd8.;
datalines;
101 a01 p 20160102
101 a01 b 20160103
102 b02 b 20160104
102 b02 b 20160105
103 c03 p 20160106
103 c03 p 20160107
103 c03 b 20160108
;
run;
The second Dataset attached called:
Want generated 30NOV2020
data want ;
format date_1 date9. ;
input id $ sp_num $ type $ date_1 yymmdd8.;
datalines;
101 a01 b 20160103
103 c03 b 20160108
101 a01 b 20160103
103 c03 b 20160108
101 a01 b 20160103
103 c03 e 20180108
101 a01 f 20180103
103 c03 d 20160108
101 a01 s 20180103
103 c03 e 20180108
;
run;
I want my OUTPUT to look like this: All new rows added to be highlighted or indicated in a new column called row_stats
I will be super excited if anyone could help me out.
Most of us will not download and open Microsoft Excel files (or any files) because it can be a security threat. Please include a portion of your data in your message by following https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/ (and not in any other format). The desired output can be included into your reply as a screen capture.
Once you have read in and sorted both data sets, use PROC COMPARE to find differences. In this case, use a BY statement. It will do a much more accurate and thorough job, and is much simpler than trying to code it yourself.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.