Import prices rose 0.7 percent compared to July, while export prices rose 0.9 percent.
Stocks also found encouragement from markets in Asia and Europe.
Asian markets found support from Chinese Premier Wen Jiabao, who said that China's economy would reach its 2012 goal of 7.5 percent growth.
The Wall Street Journal reported that stock in Europe got a boost from a constitutional court decision in Germany that would allow the German government to participate in the international rescue fund meant to assist eurozone countries struggling to climb out of debt.
By close of trading on Wall Street, the Dow Jones industrial average gained 9.99 points, or 0.07 percent, to 13,333.35. The tech-heavy Nasdaq Composite index added 9.78 points, or 0.32 percent, to 3,114.31. The Standard and Poor's 500 added 3 points, or 0.21 percent, to 1,436.56.
On the New York Stock Exchange, 1,876 stocks advanced and 1,054 declined on a volume of 3.3 billion shares traded.
The benchmark 10-year treasury fell 16/32 to yield 1.763 percent.
The euro rose to $1.2896 from Tuesday's $1.2855. The U.S. dollar rose to 77.88 yen from 77.77 yen.
In Tokyo, the Nikkei 255 index added 1.73 percent, 152.58 points, to 8,959.96.
In London, the FTSE 100 index shed 0.17 percent, 10.11 points, to 5,782.08.
2014: The Year in Music [PHOTOS]