Corporate America has taken a beating.

The past three to four years have been the worst for American business since the 1930s, economist Allen Sinai of Data Resources Inc. said last week. Corporate profits will almost certainly be down again in 1982 for the third year in a row, according to figures collected by the Commerce Department. This is "unprecedented" for the post-war period, Sinai said.

The devastation to sales from the recession, and the extra squeeze that has come as interest rates stayed high long into the downturn, have pushed bankruptcies to their highest level since the early 1930s. Many other companies are hovering on the edge of failure, and analysts warn of the dreadful state of company balance sheets.

However, there are some who see light ahead for corporate treasurers, even if not for the unemployed victims of recession.

It is not that these analysts are expecting a sudden boom in the economy. But even a small revival in depressed markets could transform company balance sheets, they argue, as a result of the cost-cutting measures that businesses have been forced to take to survive.

"Next year you could get a big increase in earnings without the support of a big increase in sales," Dmitri Balatsos of Manufacturers Hanover said last week. Sinai agrees that the profits picture will improve substantially beginning the middle of next year, even if the economic recovery which he and others are forecasting is relatively weak and sluggish.

One reason for expecting only a rather disappointing recovery is that businesses do not plan to spend much next year, even if consumers step up their purchases. A McGraw-Hill Inc. survey published earlier this month showed companies planning to cut back spending by 8 percent in real terms, after accounting for inflation. With capacity utilization in manufacturing at a post-World War II low of 68.4 percent last month, it will take a big expansion in demand for companies to be persuaded to add to capacity.

Cutbacks in capital spending plans hurt the economy while they help the outlook for corporate balance sheets. It is likely that the "very substantial repairment of corporate liquidity" predicted by some for next year will be "at the expense of corporate participation in the economic game," warned Balatsos.

It has been clear for some time that consumers will have to lead the economy out of recession. But a sustained, long-term recovery depends on an upturn in investment. With a more cautious and risk-averse business sector concentrating on improving balance sheets rather than expanding to catch new business, a strong recovery will be some time coming.

"A horrible financial squeeze" has combined with declining sales to push much of corporate America into a "midlife crisis," Sinai said last week. Interest costs ballooned in 1980 and 1981 to a point where they were greater than domestic retained earnings for the first time ever, one bank economist said. From $44.8 billion in 1979, net interest expenses for nonfinancial corporations swelled to $62.5 billion last year, he said. Meanwhile, these companies' retained earnings on domestic operations shrank from $67.3 billion to $55.7 billion.

The extraordinarily high interest rates throughout much of the recession put a tremendous squeeze on companies forced to borrow to finance unwanted inventories and keep up cash flow while sales plummeted. High rates also delayed the "reliquefaction" of the corporate sector, which normally takes place during recession. Under this process, companies borrow long from the bond market to pay off short-term bank debt and get back into shape for expansion, analysts say. While long-term rates stayed high, companies were reluctant to lock them in.

As rates have come down since the summer, companies have leaped into the bond market. New corporate bond issues for nonfinancial companies averaged only $1.7 billion a month in the first half of 1982, compared with a monthly average of $2.97 billion last year. In July, the bond market began to open up as short and long rates dropped. Issues climbed to $1.9 billion. By August they had reached $4.3 billion and, after dipping slightly in September, hit $4.97 billion last month.

This is further evidence that a turnaround in company finances is underway, many believe. But the improvement in liquidity of the last few weeks "has a long way to go" before companies are back to prerecession health, Judith Mackay of Townsend-Greenspan commented last week.

They may never quite return to old ways of doing business, Sinai believes. The squeeze on companies during this recession has been so severe that many have made far-reaching changes in their operations, he argues. Cost cutting measures ranging from large-scale layoffs, to canceling plans for new capital spending, to "skinnying" back expense accounts have reduced the cost structure of many businesses, analysts agree.

Some companies have stayed in business by selling off losing operations, others by closing plants and trying to sell off the idle factories and equipment. And most have tried to hold down wage costs and reduce employment levels.

"We've done a great deal to negotiate through the difficulties" posed by the recession this year, according to Edward G. Jefferson, chairman of E. I. du Pont de Nemours. Du Pont has managed to stay in the black this year despite capacity utilization, excluding the Conoco operations, of about two-thirds. In the past, earnings would have been squeezed more at such low operating levels, Jefferson noted.

Companies have also slashed inventories this year, although the length and depth of the recession took most by surprise. "Many companies probably misjudged the recovery," leaving inventories "unusually high, and in retrospect they are still high" in relation to sales, Balatsos said. A second wave of inventory liquidation is expected to drag down the overall gross national product for the final quarter of 1982, Commerce Department Undersecretary Robert Dederick warned on Friday.

Emergency cost-cutting has not saved industry from the recession. But the optimists believe that it will at least help companies to benefit quickly from any upturn that comes along. If companies can now stay in the black at very low operating rates, they will start to make substantial gains if and when the economy picks up. Du Pont has "strong upside potential" now, according to Jefferson.

The slowdown in wage costs over the past year -- from an annual increase of about 9 percent in the middle of 1981 to around 6 percent now -- is "very important," Mackay said. "It means that when sales pick up there can be a larger proportion of profits going to balance sheets. . . i.e., profits can rise."

"Most companies will flow any increase in volume through to the bottom line," Sinai agreed.

Data Resources predicts that profits of 551 companies that it tracks--whose profits account for between 70 and 75 percent of total corporate earnings -- will show a smart upturn in the third quarter of next year, after reaching a low point in the final three months of 1982. For 1983 as a whole, DRI is forecasting a 13 percent gain in profits from depressed 1982, followed by increases of 18 percent and 17 percent in 1984 and 1985.

This would be a startling turnaround from the declines reported for quarter after quarter of this long recession.

One reason for the particular damage that business has suffered in this recession is that the latest downturn in the economy, which began in July 1981, hit companies before they had had time to recover from the previous dip in 1980. The National Bureau of Economic Research, the usual arbiter of what is a recession, divides the last three years into two cycles. But as the peak in 1981 came just one year after the previous trough, many economists regard the period as almost equivalent to one long downswing.

The profits of the DRI 551 companies were, for example, higher in the first quarter of 1980 than in the subsequent brief upturn in the middle of 1981. Taking the 1980 first quarter as the last peak, profits have been slashed by almost one-fourth over the course of the recession. The Commerce Department series for company profits tells an even more dramatic story. It shows a decline of close to one-third from the first quarter of 1980 to the trough, which this series dates in the first three months of 1982.

Since that trough, profits have remained very depressed, although third quarter figures released last week suggest some improvement. After-tax book profits climbed 2.4 percent, while operating profits from current production were up 6.8 percent. On the last measure, which Dederick said was a good indication of corporate health, profits slumped by 14.6 percent in the first three months of this year and were down another 1.1 percent in the second quarter. Even after the third quarter improvement, they remain 14 percent below the level of a year ago.

The recession has hit companies across the board, with very few industries now doing well. However, some have been damaged much more than others. Manufacturing industry has been hurt far more than services. Employment declines since the recession began have been heavily concentrated in manufacturing.

Among the worst performers in the third quarter were steel, with net losses of $684 million; automotive industries, $348 million; metals and mining, $78 million; savings and loans, $74 million; special machinery, $54 million; general machinery, $70 million; and containers, $24 million, according to a recent Business Week survey of corporate profits.

With interest rates expected to stay relatively high, a strong dollar and dim prospects for capital spending, durable goods manufacturing for consumer and capital goods is likely to remain relatively depressed for some time. Among the better performing sectors are high technology, financial services, utilities and telecommunications, Sinai said.

While he believes that the corner has been turned even for the hardest hit companies, others caution that this depends on there being at least some upturn in the overall economy next year and continued declines in interest rates. If 1983 turns out to be another year of recession or stagnation, with still high borrowing costs, many of those companies now hanging may be forced into failure.