Thirty-five states and the District have failed to recoup all of the factory jobs lost in the past two recessions, a loss that amounts to the elimination of more than 8 million jobs since 1979, according to a Labor Department report to be released today.

Six states have lost more than 500,000 jobs each since the recession in 1980. Illinois has lost the most, 1.3 million, followed by Pennsylvania, 1.1 million; Ohio, 1.1 million; Michigan, 962,000; New York, 676,000, and Indiana, 517,000.

Many private economists maintain that, despite large gains in jobs in the services industry and the shrinking proportion of jobs at factories, manufacturing is still important because those jobs provide employment that buys goods and services in other areas. Manufacturing also leads to advances in high technology, and exports of manufactured goods pay for the bulk of imports brought into the United States.

"Our country cannot sustain an enormous trade deficit indefinitely," said Jerry Jasinowski, chief economist for the National Association of Manufacturers. "The goods we purchase must be paid for."

In addition, productivity in manufacturing in recent years has been about three times as high as that in services, Jasinowski said. Those productivity gains help to keep costs and prices down.

The effect of the sharp slowdown in economic activity since the third quarter last year "has been very pervasive across all of manufacturing except business equipment, defense and space industries," Jasinowski said. Manufacturing has been particularly hard hit by long-term structural problems such as foreign competition, high interest rates and lower prices for some manufactured commodities, Jasinowski said.

According to the Labor Department study of 139 industries in manufacturing, 107 still have employment at levels equal to or less than levels before the recession in 1980, accounting for 2.3 million jobs. The remaining 32 industries gained 802,000 jobs since 1980.

Out of the industries that failed to regain their lost employment, 48 contributed about half of the loss and have continued to lose employment since the 1981 recession, the Labor Department study said. The remaining 59 industries have regained some employment since the depths of the last recession but are still below their peaks before 1980.

Although most of the states have failed to regain their factory jobs, 14 states have gained employment, led by California, 352,000; Florida, 319,000, and Arizona, 168,000.

Maryland lost 120,400 jobs, Virginia gained 44,400 jobs and the District lost 3,200 jobs.

Private economists said some industries have lost jobs because of long-term declines and others have suffered from cyclical swings.

For example, Roger Brinner of Data Resources Inc. said many industries have been hurt by the high value of the dollar. Employment in manufacturing would have been 1.5 million higher if the dollar had stayed at the same level as in 1980. Another 600,000 jobs were indirectly lost as a result of the elimination of the factory jobs, he said.

According to Brinner, manufacturing production would have increased 9.4 percent since 1980 if the dollar had remained stable.

* If the dollar had not appreciated sharply: The textile industry would have gained 78,000 jobs and increased production by 16.6 percent. The apparel industry would have increased employment by 112,000 and production by 11.9 percent.

* Chemicals and related products would have had 66,000 more jobs and a 10.6 percent production increase.

* Primary metals, including steel, would have gained 69,000 jobs and had 13.8 percent higher production.

* Nonelectrical machinery would have had 250,000 additional jobs and 15.1 percent higher production. Electrical machinery would have gained 241,000 jobs with 17.1 percent higher production.

According to the Labor Department study, the industries with the largest job losses since 1980 were: blast furnaces and basic steel products, construction and related machinery, womens and misses outerwear, plastic materials and synthetics, footwear (except rubber footwear), weaving mills, glass and flatware and knitting mills.

Those with the largest job gains have been communication equipment, electronic components and accessories, office and computing machines, commercial printing, miscellaneous plastics products, guided missiles, space vehicles and parts, newspapers, motor vehicles and equipment and periodicals.