Hi,
I am trying to compare two rows from tables and highlighting mismatch data with color codes, in the output getting color for matched data also see the below example.
in old column and new column contain same data as "0" it should not be highlighted.
| old | new |
| 4.05.314 | |
| 0 | 0 |
| 0 | 0 |
| 0 | 0 |
| 5.772 | |
| 0 | 0 |
| 0 | 0 |
| 0 | 0 |
| 584 | 584 |
| 7.479 | 7479 |
| 1.130 | 1130 |
| 1.236 | 1236 |
| 928 | 928 |
i written the below code,
COL old new;
define old / display;
define new / display;
compute old
if (old ne new) then
call define (_col_,"style","style={background= orange}");
end compute;
Do the comparison in a datastep and set a flag in the data. Then use a simple proc report to print the data, and us the flag to do the traffic lighting.
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.