If a person is in janabat and there isn't water at home for ghusl-e-janabat. is it okay to perform taimum and perform Namaaz?

One must search for water or buy it if they can and if not then they have to wait until the end of the time and search for water in the mean time. If at the end of the time for namaz there is no water then they can do tayammum.