Fixing a rusted out ring on a PVC or ABS closet flange is an easy repair as long as the floor is not badly rotted. When you remove a toilet and discover the steel ring on a PVC or, ABS closet flange has rusted out, your easy job of resetting a toilet has just gotten more difficult. Don’t despair the job is still something you can handle unless the floor is in really bad condition.
The floor underneath where the rotted out ring was needs to be strong enough that the new ring can be secured in place with as many of the six screw holes used as possible. I would consider four screws to be an absolute minimum amount and I would prefer if all six could be used. I would also plan on using #12 brass or stainless steel wood screws that have a long enough grip length to make it through all the layers of the floor and sub floor. In some cases with a rotted floor you can take wood and attach it to the under a marginal floor to provide a decent attachment for the screws. This may delay the need for a new floor for a while.
You will need to remove the entire rusted out steel ring from the plastic closet flange even where it goes into the grove on the plastic flange. Oatey makes a #42777 Moss Bay Replacement Flange Ring which Lowe’s sells as well as many other places. You will need that as well as #12 screws of either brass or, stainless steel long enough to grip all the flooring, 5/16 closet bolts, new braided stainless steel supply line, and a wax ring without the black plastic horn.
Place the two pieces of the Oatey Moss Bay Replacement Flange Ring around the plastic flange with the Ring locking into the groove of the plastic part of the flange. Get the ring lined up in the proper location for the closet bolts. I usually use the closet bolts to hold it together and in the locking ring before I fasten the ring down. Once lined up I secure the Oatey Moss Bay Replacement Flange Ring in place with the screws hopefully getting all six in place.
Once the Oatey Moss Bay Flange Replacement Ring is screwed in place I then reset the toilet in the usual manner with a wax ring without the plastic horn and a new stainless steel supply line and caulk around the base, then check for leaks.