Wholesale prices in the U.S. rose less than expected in July as high energy costs were offset by a sharp drop in food prices.

Meanwhile, the U.S. trade gap hit another record in June as exports slipped and the nation’s energy-import bill rose amid high oil prices.

A third report showed consumer confidence slipped in August.

The producer-price index for finished goods climbed 0.1% last month, after a 0.3% slide in June, the Labor Department reported Friday. Aside from food and energy prices , gains in producer prices actually moderated: The core index, which excludes those categories, showed a growth rate of 0.1%, down from a 0.2% in June.

Economists had expected increases of 0.2% and 0.1%, in overall and core prices, respectively.

Energy prices in July advanced 2.3%, the largest increase since January. Gasoline prices rose 5.4%, reversing a 5.2% decline in June.

Food prices registered the biggest decline in more than two years, falling 1.6% after a 0.6% drop in June.

A separate report showed the trade gap widened more than expected in June to a record $55.82 billion, according to the Commerce Department, as exports slipped and energy import volumes rose despite the high price of oil. The deficit was $46.88 billion in May, up from an initial estimate of $45.95 billion. Economists had expected the June reading to show a $47.5 billion deficit.

Exports fell 4.3% to $92.82 billion, the lowest level in four months amid a drop in overseas sales of big-ticket items such as aircraft, semiconductors, and industrial machines. In contrast, imports climbed 3.3% to $148.64 billion, propelled by soaring energy costs.

Meanwhile, the University of Michigan reported its gauge of consumer confidence fell to 94 in a mid-August reading from 96.7 at the end of July. Economists had expected the gauge to tick higher to 97.5.