How do I replicate the commands below in SAS?
In the 1st line, the code appends a file and simultaneously generates a flag (validated) where validated = 1 and not validated = 0. In the 2nd line, duplicate observations are identified and simultaneously generates a flag (dup) where both duplicates = 1 and non-duplicates = 0. In the 3rd line, all duplicate observations that were contributed by the master dataset are removed (i.e. duplicate observations contributed by the append dataset are kept along with all non-duplicate observations contributed by the master dataset). In the 4th line, the duplicate flag (dup) is removed from the dataset.
append using "Not_Validated_Data", generate(validated)
duplicates tag id date, generate(dup)
drop if dup ==1 & validated ==0
drop dup