A format, whether from the SAS format library, or defined by a user can only be assigned to a variable, not to a combination of variables. So you would have to make a new variable signaling whether DATE1=DATE2. And if that is the case, you could assign that new variables a character value of 'BAD' or 'GOOD', and thereby avoid the need for a format entirely. I.e. making a new variable is the "another method" that I would suggest.
You can do this in a DATA step, with an IF test on the equality of date1 and date2, containing a THEN clause that conditionally assigns the desired value.