* TSX ends up 83.93 points, or 0.4%, at 20,265.37

* Energy sector gains nearly 2.7%; oil settles up 2.7%

* Materials group adds nearly 1%

Aug 18 (Reuters) - Canada's main stock index rose on Thursday to just short of a two-month high as higher oil prices bolstered resource shares and investors welcomed recent data that could signal a soft landing is possible for the U.S. and Canadian economies.

The Toronto Stock Exchange's S&P/TSX composite index ended up 83.93 points, or 0.4%, at 20,265.37. On Tuesday, it notched its highest closing level since June 10 at 20,269.97.

"I think the market is in a nice spot right now," said Allan Small, senior investment advisor of the Allan Small Financial Group with iA Private Wealth.

"The Fed (U.S. Federal Reserve) and the Bank of Canada would love to see a Goldilox scenario - the economy not too hot, not too slow."

Investors have worried that in the fight against inflation, central banks would have to raise interest rates to a level that would trigger a recession. But recent data has showed both an easing of U.S. inflation pressures and encouraging job gains.

The number of Americans filing new claims for unemployment benefits fell last week and the prior period's data was revised sharply lower, suggesting labor market conditions remain tight despite a slowdown in momentum due to higher interest rates.

The Toronto market's energy sector gained nearly 2.7% as positive U.S. economic data and robust U.S. fuel consumption boosted oil prices. U.S. crude oil futures settled 2.7% higher at $90.50 a barrel.

The materials sector, which includes precious and base metals miners and fertilizer companies, added nearly 1%, while heavily-weighted financials ended up 0.2%.

Canadian banks are expected to post declines in profits on average in the third quarter as a murky economic outlook drives up provisions for credit losses while market turmoil pressures capital markets and wealth management results, analysts and investors said. (Reporting by Fergal Smith; Additional reporting by Sruthi Shankar in Bengaluru; Editing by Krishna Chandra Eluri and Alistair Bell)