You need to drive for a few miles without turning the car off, generally 10 miles does it for sure.
I have driven by car for days but the code is still not set. What do one need to do to trigger the car to set the readiness flag?Your car has certian "readiness codes" that are part of the on-board diagnostics for the emissions systems. In some states, part of the emissions testing is to make sure these codes are set. If they are not set, the test cannot be completed. If your car's battery has been disconnected or gone dead, these codes are erased. It takes several days of driving under various conditions to set the codes again. If possible, do not take your car for a state emissions test until the readiness codes are set. To check if they are set, turn the ignition ON (II), but do not start the engine. The Malfunction Indicator Lamp will come on for 20 seconds. If it then goes off, the readiness codes are set. If it blinks 5 times, the readiness codes are not set.