* U.S. existing home sales, earnings boost optimism
* Euro hits 7-week high vs dollar, 3-week high vs yen
* Dollar/yen posts biggest daily gain since early June
* Bank of Canada says Canadian recession ending (Updates prices, adds comments, details)
By Wanfeng Zhou
NEW YORK, July 23 (Reuters) - The dollar and euro rose against the yen on Thursday as upbeat U.S. corporate results and housing data fueled optimism about the economy and dented safe-haven demand for the Japanese currency.
A rally in U.S. stocks further stoked investors' appetite for risk and pushed the dollar to a seven-week low versus the euro earlier. The Dow industrials rose above the key 9,000 mark for the first time since January, boosted by strong results from 3M Co and others.
"For today, the mood is absolutely cheery," said Dan Cook, a senior market analyst at IG Markets in Chicago. "The story has been yen weakness across the board as traders and investors have been cheered by some pretty positive news."
U.S. existing home sales notched a third monthly rise in June and prices hit their highest since October, fueling hopes the housing sector is finally on the mend and will help propel a broader economic recovery.
"The ailing housing sector is beginning to stabilize. That would be a necessary component for a more meaningful U.S. recovery," said Joe Manimbo, a currency trader at Travelex Global Business Payments in Washington.
The euro rose to a three-week high at 135.61 yen, according to Reuters data. It last traded at 134.22, up 1 percent.
The dollar gained 1.6 percent to 95.08 yen, the biggest daily advance since June 5. It had earlier hit 95.29 yen, the highest in more than two weeks.
"All in all, the data will further encourage the positive risk appetite tone," said Alan Ruskin, chief international strategist at RBS Global Banking and Markets in Greenwich, Connecticut.
"That equities finally look to be making headway into a new price zone will further stir the risk positive trade."
The ICE Futures' dollar index, a measure of the greenback's value against six other major currencies, hit a seven-week low of 78.420.
RALLY SHORT-LIVED?
The euro climbed as high as $1.4291, the strongest since early June, before pulling back to trade at $1.4145, down 0.4 percent on the day.
A drop in U.S. stock index futures after the closing bell following a string of disappointing results from companies, including Amazon.com Inc and Microsoft Corp, sparked caution and weighed on the euro zone single currency.
"Some of the earnings reports were a bit disappointing," said Brian Dolan, chief currency strategist at Forex.com in Bedminster, New Jersey.
"The euro's repeated failure to challenge recent highs above $1.43 has also made it vulnerable, and now we think it has the potential to fall back to the low end of the range, between $1.38 and $1.39," he added.
Some analysts cautioned that the rally in risk sentiment on Thursday could be short-lived, as sentiment remains fragile and markets are probably just one number away from seeing risk aversion coming back.
"There's still ... a lot of uncertainty about the overall global economy. We can have great news one day, just to be followed up by bad news the next," said IG Markets' Cook.
The Canadian dollar jumped after the Bank of Canada said the country's recession is ending this quarter, also helping risk sentiment.
The BoC comments propelled the Canadian dollar to its highest since June 3 against the U.S. dollar, which last traded down 1.2 percent at C$1.0872. (Additional reporting by Gertrude Chavez-Dreyfuss; Editing by James Dalgleish)