Fear of war in the Persian Gulf jolted oil prices for the third straight month in October, but slowing economic growth held wholesale price inflation for nonfood and non-energy items to zero.

The Labor Department said yesterday that its producer price index for finished goods, one step short of retail, jumped a seasonally adjusted 1.1 percent last month.

That followed increases of 1.6 percent in September and 1.3 percent in August, bringing the annual inflation rate for the year so far to 7 percent -- the steepest price rise since 1981.

Even though the October number was higher than expected, stock and bond markets rallied immediately after the report because prices outside the volatile food and energy sectors were unchanged.

The Dow Jones industrial average climbed 44.80 points to close at 2,488.61 yesterday. Traders took the news of a zero percent "core" inflation rate as a sign that the Federal Reserve Board is likely to stimulate the economy with lower interest rates after its policy makers meet Tuesday.

The bellwether 30-year Treasury bond gained almost a full point.

Economists are optimistic that despite the sharp rises of the last three months, inflation will remain under control unless a Middle East war destroys Saudi Arabia's oil-production facilities. The economy is simply too weak for most goods producers to pass on higher energy costs, they say.

In fact, the latest edition of a prominent survey of private economists said the nation likely will topple into a recession before the end of the year.

Blue Chip Economic Indicators of Sedona, Ariz., reported yesterday that 44 of the 55 economists in its survey believe a recession will start before the end of 1990. Another three said the slump would start in 1991.

To symbolize the shift, the survey newsletter changed the color of its nameplate from yellow to red for the first time since the 1981-82 recession.

"The climate is not going to be favorable for an increase in inflation," said economist Robert G. Dederick of Northern Trust Co. in Chicago. "We're in a bad inflation patch now, but we'll get through it."

In October, energy costs led prices higher, rising 8 percent. Heating oil prices rose 15 percent and were 67.5 percent higher than a year earlier. Gasoline prices increased 8 percent and were 50.2 percent higher than a year earlier.

Food prices, meanwhile, rose 0.9 percent. Higher egg and beef prices were partly offset by declines in the prices of fresh fruit, rice, chickens, fish, dairy products, coffee and cooking oils.

Other declines were recorded for men's and boys' clothing, floor coverings and household flatware.