Updated with closing stock prices.

Stocks in New York eked out slight gains Thursday as the market digested positive surprises from the weekly jobless claims report and Alcoa's ( AA) quarterly earnings but also dismal June retail sales.

The Dow Jones Industrial Average rose 4.76 points, or 0.06%, to 8183.17, while the S&P 500 gained 3.15 points, or 0.4%, to 882.68. The Nasdaq Composite climbed 5.38 points, or 0.3%, to 1752.55.

Merck ( MRK) was the worst performer on the Dow, falling 3.7% on news that a trial comparing its cholesterol drug Zetia to Abbott's ( ABT) Niaspan had been stopped early.

On the other hand an upgrade to Goldman Sachs ( GS) helped to boost the financial sector, and an upgrade to KB Home ( KBH) helped to juice housing stocks. Goldman rose 3.4%, and KB Home tacked on 9.3%. P/>
chart
Click to Listen
Market Q&A

 Market Roundup

The Department of Labor gave stocks a boost early in the day with a report that there were 565,000 new jobless claims last week, far better than expectations for 603,000 and down from an upwardly revised 617,000 the week prior. However, the advance number on those continuing to receive benefits for the week ended June 27 increased 159,000 to 6.883 million, and the four-week moving average for insured unemployment was 6.769 million, an increase of 12,000 from the week prior.

"Of course, the bad thing is that continuing claims continue to be really bad," says Linda Duessel, equity market strategist at Federated Investors. "The backdrop for the unemployment situation hasn't changed; it continues to be the less-bad idea, which is the first thing you have to do before you get better."

In the second economic release of the day, the Department of Commerce reported that wholesale inventories fell by about 0.8% in May vs. expectations for a 1% decline and after a 1.3% reduction in April.

The major U.S. indices closed in mixed territory Wednesday ahead of Alcoa's results, the first quarterly report of the stocks in the Dow Jones Industrial Average. The aluminum maker reported its third straight quarterly loss but beat expectations on the top and bottom lines, sending shares higher in after-market trading.

"Now Alcoa has the staying power and reduced cost base to withstand the most serious downturn in the history of the aluminum industry," CEO Klaus Kleinfeld said in a statement. "Our operational and financial initiatives also provide Alcoa with the focus and flexibility to compete and grow in the most profitable segments of the industry as the economy recovers."

Earnings will get into full swing next week with reports from the likes of JPMorgan Chase ( JPM), Intel ( INTC), Bank of America ( BAC) and Citigroup ( C).

The last few weeks have been light on earnings preannouncements, which usually sets the stage for weakness in stocks during earnings as such announcements temper expectations and create the opportunity for positive surprises, says Duessell.

On the other hand, expectations aren't high. "The expectations are down 34%, which should mean that enough bad news is priced into the market that if they show us negative things, it shouldn't' hurt so much," she says.

 Market Roundup

Outside of earnings, a slew of retailers released their June sales. Department store J.C. Penney ( JCP) reported a not-as-bad as expected 8.2% decline in sales, while Macy's ( M) said its sales fell 8.9%, roughly in line with expectations. Costco ( COST) said its same-store sales fell 6% in June, also in line with expectations.

Among the misses: Target sales fell 6.2% vs. expectations for a 5.6% decline, and Limited Brands ( LTD), Wet Seal ( WTSLA) and The Children's Place ( PLCE) all reported double-digit declines in same-store sales, worse than expectations for 8%-9% declines.

In other news, insurer American International Group ( AIG) is in discussions -- again -- with MetLife ( MET) about a deal for all or part of AIG's foreign life-insurance unit American Life Insurance, reports say. AIG shares were down 27.6%, or $3.62, at $9.48.

Meanwhile, Citigroup ( C) said CFO Edward "Ned" Kelly will become vice chairman and take on broader responsibilities for strategy and M&A. Many believe Kelly is being groomed as an eventual successor to CEO Vikram Pandit, TheStreet.com reports. Shares rose 1.9% to $2.67.

Commodities were mixed. Crude oil futures rose 27 cents to $60.41 while gold climbed $6.90 to $916.20. The dollar gained strength vs. the yen but weakened against the pound and euro.

Longer-dated Treasuries were falling in price, rising in yield after an $11 billion auction of 30-year bond notes with a bid-to-cover ratio of 2.36 - meaning investors offered 2.36 for every dollar of debt available-- and a high yield at 4.3%. The 10-year was losing 20/32 to yield 3.39%, while the 30-year edged down 1-10/32, yielding 4.27%.

Stocks overseas were mostly higher. In Europe, London's FTSE 100 and the DAX in Frankfurt rose 0.5% and 1.3%, respectively. In Asia, the Nikkei in Japan lost 1.4%, but the Hang Seng in Hong Kong advanced 0.4%.

More from Markets

Week Ahead: Trade Fears and Stress Tests Signal More Volatility To Come

Week Ahead: Trade Fears and Stress Tests Signal More Volatility To Come

Trump Takes Aim at Auto Imports; Markets End Mixed -- ICYMI

Trump Takes Aim at Auto Imports; Markets End Mixed -- ICYMI

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

Flashback Friday: The Market Movers

Flashback Friday: The Market Movers