The S&P 500 and the Nasdaqfell in volatile trading on Thursday, with uncertainty about Greece and declining materials shares keeping a lid on the market.

Research In Motion , down 1.2 percent at $34.75 and reversing earlier gains, weighed on the Nasdaq ahead of its results after the bell. Analysts have said it will struggle to impress investors.

Losses were contained, however, as investors looked for value after the recent sell-off. The Dow was up slightly and even the Nasdaq regained some ground after falling slightly more than 1 percent in late afternoon trading..

Friday marked the S&P 500's sixth straight down week, and many investors view the market as oversold.

The S&P materials sector <.GSPM> lost 1.6 percent while the S&P financial sector <.GSPF> slipped 0.1 percent.

Even though experts say U.S. banks' exposure to Greek debt may be smaller than many market participants fear, many investors worry the lack of a deal to resolve the Greek debt crisis could crimp market liquidity.

It's the uncertainty of what it means, and Dodd-Frank, said Marc Pado, U.S. market strategist for Cantor Fitzgerald & Co in San Francisco. He was referring to the intensive lobbying of congressional Republicans by big banks, which are resisting the higher capital standards required by the Dodd-Frank banking reform law passed last year.

We need banks to move forward and give them the rules of the game. It's becoming a frustration for the market that we don't know what the rules are, Pado said.

Energy shares, which had helped lead gains earlier in the day, declined along with oil prices. The S&P 500 energy index <.GSPE> was down 0.2 percent.

The Dow Jones industrial average <.DJI> was up 19.90 points, or 0.17 percent, at 11,917.17. The Standard & Poor's 500 Index <.SPX> was down 2.83 points, or 0.22 percent, at 1,262.59. The Nasdaq Composite Index <.IXIC> was down 20.75 points, or 0.79 percent, at 2,610.71.

The S&P 500 has dropped roughly 7 percent since its May highs.

Analysts are eyeing technical support for the S&P 500 at 1,256.81, its 200-day moving average, and at the 2011 low near 1,250.

Dow component American Express Co was up 1.7 percent at $48.09, helping to bolster the blue-chip average.

Among the day's upbeat company news, shares of Kroger Co , the biggest U.S. supermarket operator, jumped 4.6 percent to $24 after it posted a higher-than-expected quarterly profit that was helped by cost controls and a rise in sales. Kroger also boosted its full-year profit forecast.

The day's data painted a mixed picture of the economy.

Factory activity in the U.S. Mid-Atlantic region unexpectedly shrank in June, another sign of weakness in the manufacturing sector, according to the June reading of the Philadelphia Federal Reserve Bank's business activity index..

Another report on Thursday showed the number of Americans signing up for jobless benefits fell last week, while housing starts and building permits rose in May.

(Reporting by Caroline Valetkevitch; Editing by Jan Paschal)