Mixed consumer and retail data kept stocks near break even on Friday, but major indexes edged higher for a second straight week.

The S&P 500 failed to build on Thursday's gains, which pushed it to a 17-month high, in what was a tepid week for both bulls and bears. With few economic data points or corporate earnings reports, the stock market struggled for direction.

The little data we've seen was of a mixed variety. All you can call it is a positive bias, said Joseph Battipaglia, market strategist at Stifel Nicolaus in Yardley, Pennsylvania.

February retail sales rose after forecasts had called for a decline and a Dow Jones index of retailer stocks <.DJUSRT> gained 0.5 percent. Macy's Inc rose 3.3 percent to$21.75.

But a separate report showed consumer sentiment edged lower in early March, according to a survey that noted a less positive view of the job outlook.

The Dow Jones industrial average <.DJI> gained 12.85 points, or 0.12 percent, to end at 10,624.69. The Standard & Poor's 500 Index <.SPX> shed 0.25 point, or 0.02 percent, to 1,149.99. The Nasdaq Composite Index <.IXIC> dipped 0.80 point, or 0.03 percent, to close at 2,367.66.

For the week, the Dow gained 0.55 percent, the S&P 500 climbed 1 percent and the Nasdaq advanced 1.78 percent.

Bank shares slid after having dominated the week's activity on what analysts saw as an improved outlook for the sector. Citigroup Inc fell 5 percent to $3.97 on Friday, but was still up 13.4 percent for the week, its best since August.

On Friday, the KBW bank index <.BKX> dropped 0.9 percent.

Health insurers' stocks fell as a group, with the Morgan Stanley healthcare payor index <.HMO> down 1.4 percent, its largest daily percentage drop in three weeks. Aetna Inc dropped 2.6 percent to $31.84.

Caterpillar Inc jumped 2.5 percent to $60.36 and ranked as the Dow's top points gainer a day after the heavy equipment maker said it could triple its current U.S. output of hydraulic excavators.

CF Industries Holdings Inc fell 3.9 percent to $96.73 after Agrium Inc abandoned its $5.4 billion bid for the company, bringing CF closer to clinching a deal with Terra Industries Inc . Agrium jumped 8 percent to $72.10.

In other economic data, the Commerce Department said business inventories were unchanged in January, compared with a forecast for a 0.2 percent rise.

About 8.3 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's estimated daily average of 9.65 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of about 5 to 4. On the Nasdaq, the trend was reversed, with about six stocks falling for every five that rose.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)