Erasing OBD2 code while car running harmful? possible?

I almost hit the erase button on the scan tool before realizing the car was running. What would happen if I tried to erase the code while the car was running, for that matter driving? Would the car accept it, or would it prevent it? Could it damage the car? FWIW 2005 Subaru Outback, but really asking it in general.

Never tried while driving, it accepted the reset in all cases, I doubt it. IME, I’ve reset the codes on several different vehicles (among them my 2007 Legacy, 2014 F-350, 2011 Dodge 3500, 2003 Ford Focus,…) and never had any issues with them accepting the reset or causing any damage. I’m sure our ASE certified garage people will know much better than myself, though.

Should not matter.

I do it all the time. In my 2006 Mazda 3 it would “reset” the seatbelt warning so that would go off if you didn’t have a belt on. The other vehicles haven’t even done that much (other than turn off the CEL of course).

nothing bad. DTCs are held in a special region of PCM memory, and “Clear DTCs” is just a basic diagnostic command. clearing codes does not reset the PCM nor interfere with its normal operation.

however, if your state does emissions inspections, you may fail if you get it tested right after clearing codes. A code clear or pulling the battery means the PCM sets “OBD Monitors Not Ready,” and you have to drive the car for long enough without a fault occurring before it will report it’s ready for test.