Studying the role of gas in galaxy evolution with large spectroscopic surveys