By Joseph Adinolfi, MarketWatch , Hiroyuki Kachi

Canadian dollar rises to nearly 3-month high after strong data

The U.S. dollar inched higher against its main rivals Friday, snapping three sessions of losses, as fears of a Greek default drove the dollar higher.

The euro (EURUSD) traded at $1.0755, compared with $1.0769 Thursday. The dollar (USDJPY) rose to Yen119.14 yen, compared with Yen118.98 late Thursday in New York.

The Labor Department said Friday that core consumer prices rose 0.2% in March on the back of higher gas prices, matching expectations of economists polled by MarketWatch. Core prices increased by the same amount in February.

Read: Consumer prices move up in March for second month (http://www.marketwatch.com/story/consumer-prices-move-up-in-march-for-second-month-2015-04-17)

Aside from Friday's gauge of consumer-price inflation, U.S. economic data released since Monday has been weak, weighing on the dollar and suggesting that the Fed will wait longer before raising interest rates.

Greece's Kathimerini newspaper reported Friday that central banks of Southeastern European countries have told subsidiaries of Greek lenders operating in their countries to exit all exposure to Greek sovereign debt, which the market interpreted as a sign that a Greek default is imminent.

Read: Greek banks abroad shed Greek bonds on default fears (http://www.marketwatch.com/story/greek-banks-abroad-shed-greek-bonds-on-default-fears-report-2015-04-17)

Sebastien Galy, director of FX strategy at Société Générale, said that Greek default fears were driving investors into the dollar.

"The [CPI] data itself was a little mixed," Galy said. "To be frank, really what you're seeing here is risk reduction linked to Greece."

The dollar's strength was part of a broader trend of investors dumping risk assets like stocks, Galy said. Stocks traded lower around the world, and emerging-market currencies like the Mexican peso (MXNUSD) sold off, as investors sought the perceived safety of the U.S. dollar and the Swiss franc (EURCHF).

Read: European stocks drop further, heading for sharp weekly loss (http://www.marketwatch.com/story/european-stocks-head-lower-on-track-for-weekly-loss-2015-04-17)

Elsewhere, the Canadian dollar rallied against its U.S. counterpart after retail sales for February and the March consumer-price index came in above economists' expectations.

The loonie (CADUSD) traded at 82.18 cents, its highest level in nearly three months, compared with 81.97 cents Thursday.

Subscribe to WSJ: http://online.wsj.com?mod=djnwires