This ternary operator evaluates the first field (SeqNum) for 6+ digits, which it seems your datasets have. If there's a match, the first field is used as the key, else the concatenation of fields 0, 1, and 8 is used as the unique key identifier. (Of course, you're going to have to choose fields to concatenate that you think will not be different between the two records whose fields you'll be examining for differences.)

Tried this on a data set with the SeqNum removed in one record and it worked, although your mileage may vary so some tweaking may be in order.