By Noel Randewich and Caroline Valetkevitch

(Reuters) - The Dow and S&P 500 eased from record highs on Friday as tepid data dampened investor confidence in the economy's expansion, while the Nasdaq inched up to a second straight record high close.

Among the S&P 500's biggest drags was Dow Chemical <DOW.N>, which fell 2.4 percent to $52.33, while DuPont <DD.N> declined 1.9 percent to $67.66, a day after European Union regulators opened a full investigation of their $130 billion merger agreement.

The S&P materials index <.SPLRCM>, down 1.2 percent, led sector declines in the benchmark index.

Economic data showed U.S. retail sales growth was unexpectedly flat in July as people cut back on buying clothes and other goods, while the producer price index fell 0.4 percent in July, the biggest drop in nearly a year.

All three major U.S. stock indexes ended at record highs on Thursday for the first time since 1999, extending a recent rally that has increased investor concern about pricey valuations.

"It's gotten to a level which I would call overvalued ... and maybe I can't call it a bubble yet but we're pretty close in my view," said Hugh Johnson, chief investment officer of Hugh Johnson Advisors LLC in Albany, New York, adding, "It's not as speculative as 1999."

In the dot-com bubble from about 1997 to 2000, investors saw a rapid rise in stocks, especially those related to the internet.

The Dow Jones industrial average <.DJI> was down 37.05 points, or 0.2 percent, to 18,576.47, and the S&P 500 <.SPX> lost 1.74 points, or 0.08 percent, to 2,184.05, while the Nasdaq Composite <.IXIC> added 4.50 points, or 0.09 percent, to 5,232.90, a record high close.

For the week, the Dow rose 0.2 percent, the S&P 500 edged up 0.1 percent and the Nasdaq gained 0.2 percent.

Giving the Nasdaq its biggest boost on Friday, shares of chipmaker Nvidia <NVDA.O> gained 5.6 percent to $63.04, a day after it reported its fastest quarterly sales growth in nearly five years.

Also among the day's bright spots, Nordstrom <JWN.N> rose 8 percent to $51.38 after the department store chain operator reported better-than-expected comparable sales and quarterly profit.

J.C. Penney <JCP.N> shares jumped 6.1 percent to $10.55, also following upbeat results. The S&P retail index <.SPXRT> rose 0.3 percent.

Energy shares also gained, with the S&P energy index <.SPNY> rising 0.7 percent as oil prices <CLc1> <LCOc1> settled more than 2 percent higher.

Exxon Mobil <XOM.N> rose 1.3 percent to $87.85 and gave the biggest boost to the Dow and S&P 500, while Chevron <CVX.N> added 0.75 percent to $102.16.

Declining issues outnumbered advancing ones on the NYSE by a 1.06-to-1 ratio; on Nasdaq, a 1.07-to-1 ratio favored decliners.

The S&P 500 posted 22 new 52-week highs and no new lows; the Nasdaq Composite recorded 77 new highs and 31 new lows.

About 5.6 billion shares changed hands on U.S. exchanges, compared with the 6.4 billion daily average for the past 20 trading days, according to Thomson Reuters data.

(Editing by Dan Grebler and James Dalgleish)