Stock markets posted modest gains Tuesday on the strength of a consumer price report, despite another increase in oil prices.

The Dow Jones industrial average rose 18.28 (0.2 percent), to 9972.83. The Dow went above 10,000 before news reports on Russian oil company Yukos's worsening tax situation. The last time the Dow closed above 10,000 was Aug. 4.

Broader stock indicators were moderately higher. The Standard & Poor's 500-stock index was up 2.37 (0.2 percent), at 1081.71, and the Nasdaq composite index gained 12.41 (0.7 percent), to 1795.25.

A barrel of light crude for September delivery was quoted at $46.75, up 70 cents, on the New York Mercantile Exchange.

The consumer price index for July dropped slightly. There had been concern that higher oil prices would spur inflation.

According to the Labor Department, the CPI fell 0.1 percent in July, the first drop in prices since November and a large shift from the price gains in May and June. Without food and energy costs factored in, the CPI rose 0.1 percent, less than Wall Street had forecast.

Housing construction also increased. The Commerce Department reported an 8.3 percent increase in home and apartment construction in July, more than making up for the 7.7 percent drop in June.

The economic data reaffirmed that, despite energy costs, the economy remained sound and that inflation, at least for now, has been kept at bay. And if oil prices fall from their current record highs, stocks will be poised to make strong gains, analysts said.

"In the short term, there's enough good news in the economic data to offset oil prices, at least for now," said Chris Wolfe, global head of equities for J.P. Morgan Private Bank. "Certainly, we can't see how these oil prices will be sustainable in the long term. We're ready for a relief rally once the prices start coming down."

A number of earnings reports from retailers also gave investors a boost. Dow component Home Depot increased $1.12, to $35.10, after the home improvement retailer reported record sales and a 19 percent increase in second-quarter profit. Home Depot raised its guidance for future quarters.

Office-supply chain Staples saw its profit rise 39 percent in the quarter, beating expectations by 2 cents per share. Staples, which also announced new ventures in Europe and China, gained 99 cents, to $28.87.

Consumer wholesaler B.J.'s Wholesale Club was up $1.77, at $25.16, after reporting a strong 25 percent rise in second-quarter earnings. The company beat estimates by 5 cents per share.

J.C. Penney matched Wall Street estimates, managing a small profit for the quarter after breaking even a year ago. Penney slipped 27 cents, to $38.48, after trading in positive territory most of the day.

Estee Lauder Cos. dropped $3.50, to close at $40.00 a share. The cosmetics firm posted strong quarterly gains, but missed analysts' estimates by a penny.

Saks fell 20 cents, to $12.00, as the luxury retailer saw its losses grow in the second quarter, missing Wall Street expectations by 8 cents per share.

Other Indicators

* The New York Stock Exchange composite index rose 4.30, to 6320.25; the American Stock Exchange index fell 6.71, to 1208.65; and the Russell 2000 index of smaller-company stocks rose 1.94, to 530.00.

* Advancing issues outnumbered declining ones by 3 to 2 on the NYSE, where trading volume rose to 1.26 billion shares, from 1.2 billion on Monday. On the Nasdaq Stock Market, advancers outnumbered decliners by 7 to 5 and volume totaled 1.36 billion, up from 1.27 billion.

* The price of the Treasury's 10-year note rose $5.63 per $1,000 invested, and its yield fell to 4.20 percent, from 4.27 percent on Monday.

* The dollar fell against the Japanese yen and rose against the euro. In late New York trading, a dollar bought 110.02 yen, down from 110.53 late Monday, and a euro bought $1.2344, down from $1.2355.

* Gold for current delivery rose to $404.00 a troy ounce, from $402.90 on Monday, on the New York Mercantile Exchange's Commodity Exchange.