Stocks advanced Thursday as traders, trying to gauge whether the economy is holding up in the face of a weakening housing market, digested mixed data ahead of Friday's jobs report.

The sluggish housing market remains a key concern on Wall Street, and the Mortgage Bankers Association said Thursday that homeowners beginnading the foreclosure process in the second quarter reached a record 0.65 percent. It was the third consecutive quarter that the figure reached an all-time high. Though investors want growth to be slow enough to merit a rate cut from the Federal Reserve when it meets Sept. 18, they don't want to see the economy weaken to the point of recession.

Wall Street also doesn't want to see signs of accelerating inflation — such as surging crude oil prices, which briefly spiked above $77 a barrel Thursday on supply worries after the U.S. embassy in Nigeria said American and other Western interests in the country are at risk of a terrorist attack and after news that Syrian armed forces had opened fire on Israeli fighters. Inflationary risks have kept the Fed from lowering interest rates in recent months.

The credit markets continue to be tight. The New York Fed, which carries out the central bank's market operation, injected a total of $31.25 billion through three repurchase agreements Thursday — the largest amount the Fed has injected in weeks — to help keep the markets liquid. The Fed also reported that about 3 percent of asset-backed commercial paper, a type of bond companies sell for quick cash, was unable to be rolled over in the week ended Wednesday.

Still, the job market, the service sector and August retail sales look good. Last week, for the first time in seven weeks, claims for unemployment benefits dropped, the Labor Department said. It also reported that worker productivity jumped to an annual growth rate of 2.6 percent in the April to June quarter, much better than expected.

The snapshots boded well for Friday's August employment report, the economic reading that investors are considering the most important this week.

"They're waiting for the jobs number tomorrow," said John O'Donoghue, co-head of equities at Cowen & Co., noting that most of Thursday's news has been fairly benign. "I think people are kind of sitting on their hands."

In early afternoon trading, the Dow Jones industrial average rose 52.27, or 0.39 percent, to 13,357.74, after earlier wobbling in and out of positive territory.

Broader stock indicators also lifted. The Standard & Poor's 500 index fell 4.06, or 0.28 percent, to 1,475.68, and the Nasdaq composite index rose 5.55, or 0.21 percent, to 2,611.50.

Bonds fell. The yield on the benchmark 10-year Treasury note, which moves inversely to its price, rose to 4.49 percent from 4.47 percent late Wednesday. The dollar was lower against most other major currencies, while gold prices jumped.

A barrel of light, sweet crude rose 5 cents to $75.78 on the New York Mercantile Exchange.

With investors on alert for any sign that recent financial market turmoil has hurt consumer spending, better-than-expected August sales from major retailers Wal-Mart Stores Inc. and Target Corp. perhaps came as a welcome surprise.

Wal-Mart said same-store sales, which measure business at stores open at least one year, rose 3.1 percent, while Target said same-store sales in August rose 6.1 percent.

The two biggest retailers beat Wall Street estimates. Wal-Mart rose 42 cents to $42.87, and Target rose $1.44, or 2.3 percent, to $63.32.

Tony department store chain Saks Inc., teen apparel retailer Pacific Sunwear of California Inc. and children's clothier The Children's Place Retail Stores Inc. also topped analyst projections. Saks rose 86 cents, or 5.7 percent, to $16.18, Pacific Sun advanced 99 cents, or 7 percent, to $15.24, while Children's Place fell 19 cents to $27.78.

Meanwhile, the Institute for Supply Management's reading on the non-manufacturing sector showed that activity expanded in August at the same rate as in July.

Not only were investors worried about the rising foreclosure rate, but late Wednesday, mortgage lender Countrywide Financial Corp. said it will cut another 900 jobs nationwide after eliminating about 500 positions last month. The nation's largest mortgage lender by volume employs about 60,000 people.

Countrywide fell 49 cents, or 2.6 percent, to $18.31.

Lehman Brothers Holdings Inc. fell 54 cents to $53.81 after the nation's fourth-largest investment bank announced it is laying off 850 people from its home lending business in the U.S. and Britain. The company previously announced the closure of its BNC Mortgage LLC subsidiary.

Advancing issues outnumbered decliners by about 3 to 2 on the New York Stock Exchange, where volume came to about 638.2 million shares.

The Russell 2000 index of smaller companies fell 1.32, or 0.17 percent, to 791.95.

Overseas, Japan's Nikkei stock average rose 0.61 percent. Britain's FTSE 100 rose 0.68 percent, Germany's DAX index rose 0.44 percent, and France's CAC-40 advanced 0.45 percent.