By Sam Forgione

NEW YORK (Reuters) - The U.S. dollar gained against a basket of major currencies on Thursday after traders looked ahead to a potential rate increase from the Federal Reserve in December and sold yen on anticipation that the Bank of Japan could ramp up stimulus next week.

The euro briefly hit a six-day high against the dollar of $1.1283 after data showing weaker-than-expected U.S. retail sales for August, which analysts said solidified expectations that the Fed would stand pat on rates at its meeting next week.

The dollar recovered, however, on the view that there was still a desire on the part of the U.S. central bank to hike before year-end.

"A December rate hike is still in play," said Brittany Baumann, macro strategist at TD Securities in Toronto, noting the dollar's rise. "There is still a good chance that a majority of participants will pencil in a rate increase," she said in reference to the Fed's Summary of Economic Projections to be released next week.

Traders see just a 12 percent chance that the Fed would hike rates at its Sept. 20-21 meeting, down from 15 percent on Wednesday, according to CME Group's FedWatch program. Traders see a 46.2 percent chance that the Fed will hike in December, the program showed.

The dollar gained against the yen on expectations that the BOJ could take action to weaken the currency at its meeting, the same days as the Fed's. Those expectations have grown in recent days on reports that the central bank could turn more accommodative.

"Running into a BOJ meeting with a moribund Japanese economy, where are you going to go with this?," said Joseph Trevisani, chief market strategist at WorldWideMarkets in Woodcliff Lake, New Jersey. "The only place to go is they’re going to do something to increase accommodation. That leads to a weaker yen."

He said conviction surrounding expectations for more BOJ stimulus was feeble, however, limiting the yen's losses against the dollar.

The dollar index, which measures the greenback against a basket of six major currencies, was last up 0.10 percent at 95.421 <.DXY>. The euro was last down 0.11 percent against the dollar at $1.1237 <EUR=>.

The dollar was last up 0.15 percent against the yen at 102.55 yen <JPY=>, but was mostly flat against the Swiss franc at 0.9727 franc <CHF=>.

(Reporting by Sam Forgione; Editing by Dan Grebler)