Stocks rose on Thursday as a mixed batch of data failed to deter buyers looking for bargains after a more than 7 percent selloff in the last few weeks.

Worries that the lack of a deal to resolve the Greek debt crisis could crimp market liquidity kept gains in check.

We're seeing a very oversold market going into the data, so that could be one reason why we're attempting to bounce, said Steve Goldman, market strategist at Weeden & Co in Greenwich, Connecticut.

Also, jobless data was a bit better this morning.

The number of Americans signing up for jobless benefits fell last week, while housing starts and building permits rose in May, offering some hope the economy could be starting to pull out of a soft patch.

Still, factory activity in the U.S. Mid-Atlantic region unexpectedly shrank in June in another sign of weakness in the manufacturing sector.

The Dow Jones industrial average <.DJI> gained 63.80 points, or 0.54 percent, to 11,961.07. The Standard & Poor's 500 Index <.SPX> rose 5.41 points, or 0.43 percent, to 1,270.83. The Nasdaq Composite Index <.IXIC> added 5.20 points, or 0.20 percent, to 2,636.66.

The S&P 500 has fallen more than 7 percent from its high in May 2. The benchmark has technical support at 1,256.81, its 200-day moving average, and at the 2011 low near 1,250.

Developments in Europe could define the market's direction.

The IMF will release loans to save Greece from default despite a likely delay by the European Union on a deal for a second bailout, sources said. Meanwhile, the Greek prime minister, beset by mass protests and resignations from his ruling socialist party, planned to reshuffle his cabinet and drive through an austerity plan.

(Reporting by Rodrigo Campos; additional reporting by Caroline Valetkevitch; editing by Jeffrey Benkoe)