You can cut the cast iron pipe and use a banded coupler (not the neoprene sleeve type) to transition to PVC. Depending on access, cut the pipe whereever it is easiest to get reach. Then use PVC pipe and fittings to connect a new flange. If the pipe is 3" you should use a flange that fits on the outside of the pipe. If it is 4" use either an inside or outside flange. Remember the flange should set level on top of the finished floor and be screwed to the sub flooring. I would use stainless steel screws.