If you use a cast iron flange, then the lead and oakum make the seal. IF it is a 3" pipe, you can get a flange that clamps to the outside of the pipe with a neoprene (?) rubber seal. If it is a 4" pipe, you can get a similar one that clamps to the inside of the pipe. Or, you can snap off of the cast and replace the whole part with pvc. while using a no-hub conection to hold them together.