You describe what is most likely a piece of galvanized pipe that was screwed into a T on the drain pipe. You just need a male threaded PVC adapter (with 2-3 flat wraps of teflon tape wrapped clockwise only on the threads as the threaded end faces you) to screw into the T. Clean up the threads on the T first.
Good Luck!
Mike
Good Luck!
Mike