From the height of the pipe my guess would be it's a vent line. Horizontal vents must run 6" above the flood rim of the highest fixture which puts them at 42" or more. It's evidently an older home using galvanized pipe for the waste and vent system.