The man who ran President Carter's anti-inflation program from 1977 to 1979 said yesterday that it isn't working and the administration should turn instead to mandatory wage-price controls.

Barry P. Bosworth, now a Brookings Institution economist, said the change is needed because inflation has built up such momentum "that nothing but a major recession or mandatory controls can break it."

The call for controls, in an interview yesterday, marked a departure for Bosworth, who consistently had opposed them during his two-year tenure as director of Carter's Council on Wage and Price Stability.

Separately, Otto E. Eckstein, former Johnson administration economic adviser, told the House Budget Committee the controls idea "deserves a serious look." However, he said mandatory restraints had not worked before.

The combination of statements constituted the first serious suggestion for a controls program by established economists in recent years. Most middle-of-the road economists have opposed controls as unworkable.

Bosworth also advocated an array of other stiff measures, including gasoline rationing or a gasoline excise tax, a prompt return to a balanced budget, tax cuts to spur productivity and incentives for capital formation.

He said the only alternative to such a package would be for the government to engineer a major recession under which the jobless rate would rise to double-digit levels of 10 percent or higher.

Bosworth's suggestions, similar to those proposed last week by Sen. Edward M. Kennedy (D-Mass.), weren't likely to be embraced by the Carter administration. Carter already has rejected Kennedy's plan. The Brookings Institution economist said he isn't working as a Kennedy adviser nor did he have any part in drafting the senator's economic proposals last week. Kennedy supported a gasoline rationing plan, but opposed a gasoline excise tax.

Bosworth's proposal would impose mandatory controls across every sector of the American economy -- including wages, prices, profits and rent -- with limits of 5 percent on pay raises and 6 percent on price increases.

The former anti-inflation official said the controllers should be empowered to break existing contracts if needed to force companies and unions to comply with the wage-prime limits. He said the program should last two to three years.

He also proposed that the government in effect ration available mortgage money by requiring extremely high down payments for home mortgage loans as a way to dampen demand for housing.

And he suggested that if food prices begin to soar again as they did last year, the government eliminate all restrictions on crop production. He urged keeping government grain reserves high to help stabilize future price surges.

Bosworth said the strong action is necessary because the "gradualism" advocated by Carter isn't working and traditional government policies to dampen inflation by reducing overall demand no longer are effective.

But he cautioned that all the elements of the proposal -- not just the controls -- are needed or the plan administration's much-criticized ex-with energy and housing costs," he said.

Bosworth also rejected the now-standard contentions that the Nixon administration's much-criticized experiment with wage-price controls in 1971-73 proved that such a program can't work.

"There were a lot of outside factors then that blew the controls out of the water," Bosworth said in the interview. "If they happen again, we'll be blown out of the water again -- with or without controls."

The factors Bosworth was referring to included a simultaneous economic boom in all the major industrial countries, overstimulation of the U.S. economy, grain sales to the Soviet Union and devaluation of the dollar.

Bosworth argued that sweeping, across-the-board action is needed because key elements of the nation's economic structure won't accept voluntary restraint programs that involved only their sector.

"Only if you say, 'Here's a whole program' will they accept the parts," he said. "The difference between a voluntary program and a mandatory one is only a matter of degree. But Its an important one."

Eckstein's remarks, delivered in testimony before the House Budget Committee, were based on similar reasoning to those offered by Bosworth, but didn't go nearly as far.

The former Johnson economic adviser, now president of Data Resources Inc., said "we're betting on recession" now to dampen inflation, and the prospects are it won't work. He said the controls idea "deserves a serious look."