I have a data table and a status table. My goal is to compare these two tables and update the status in the data table whenever there's a match with the status table. Importantly, not all columns need to match between the two tables. I want to avoid using the append function as it can lead to unnecessary data inflation. I'm considering using a macro to achieve this, but I'm unsure of how to set it up. Can someone provide guidance on how to create a macro for this purpose?
Status table
| start date | end date | origin id | origin country | service level | carrier scac | status |
| 2023-01-01 | 2023-12-31 | 12345 | | | | exception |
| 2023-09-01 | 2023-12-31 | 55446 | | TL | | no charge |
| 2023-04-01 | 2023-07-31 | | CAN | | ABC | exception |
Data table
| create date | origin id | origin country | service level | carrier scac | status |
| 2023-07-24 | 55446 | CAN | TL | ABC | normal |
| 2023-07-25 | 55446 | CAN | LTL | DEF | normal |
| 2023-07-25 | 12345 | USA | TL | ABC | normal |
Thank you,
Paul