Republican Presidential hopefuls tonight used their first nationally televised forum to criticize the "failed foregin policy" of President Carter and condemn his decision to cut back grain sales to the Soviets in protest of the invasion of Afghanistan.

The six GOP aspirants also took repeated potshots at the absentee front-runner, Ronald Reagan, who declined to participate in the two-hour session held in the state whose Jan. 21 caucuses will lead off the 1980 presidential contest.

As expected, Rep. John B. Anderson of Illinois emerged as the odd-man-out in the debate, defending Carter on the grain embargo issue and dissenting from the others on energy and tax questions as well.

Sen. Howard H. Baker Jr. of Tennessee, who used the "failed foreign policy" phrase to describe Carter's international record; former Texas governor John B. Connally; former ambassador George Bush; Sen. Bob Dole of Kansas, and Rep. Philip M. Crane of illinois took their turns criticizing Carter's energy, economic and social policies.

All the candidates put on a display of affability and good humor toward each other, while intermittently jabbing at the absent Reagan.

The former California governor stayed home in Los Angeles, saying he feared the debate would be divisive. Reagan is scheduled to resume his campaigning in Iowa Monday.

But, in fact there was more unity than conflict among the Republicans, except for Anderson. The Illinois progressive emphasized his differences in his closing comments when he said there was "too much old politics being practiced, even among Republicans."

Noting that the other five hopefuls had opposed the embargo, which threatens the prices Iowa farmers received for their grain, and had criticized his proposal for a 50-cents-a gallon gasoline tax, Anderson said, "We've got to pull up our socks in this country. We've got to ask people to sacrifice something today."

Aside from Anderson's criticisms, the tone of the debate was convivial. Many of the candidate's asides -- especially Dole's -- drew laughter from the audience in the civic auditorium.

The debate, sponsored by the Des Monies Register and Tribune, was carried live nationally by the Public Broadcasting Service and rebroadcast later by CBS-TV. A similar debate among Carter and his Democratic challengers, Sen. Edward M. Kennedy of Massachusetts and California Gov. Edmund G. (Jerry) Brown Jr. was scheduled for Monday night, but was canceled when Carter said the international crisis made his participation impossbile.

In the opening round of comments, Baker and Connally both said the Iranian hostage situation resulted from the "weakness" of Carter's foreign policy. "The only way to avoid this is to recreate the idea that America is strong," Baker said.

"Our people are hostages because we've shown weakness and appeasement," Connally said, adding that the United States should not delay in establishing "a military presence" in the Middle East.

As to specific responses now, Dole and Anderson called for an embargo of U.S. shipments to Iran. Dole said the only exception should be on emergency medical supplies and Anderson said the cutoff of links to Iran should also include cables and telecommunications.

Crane and Bush offered no specific suggestions but Crane said that if any hostages are harmed, "there must be swift, forceful retaliation."

The second question took them into Carter's key retaliatory action against the Soviets -- his embargo of 17 million metric tons of grain, much of it from the agricultural heartland of America where the debate was held.

All of the Republicans except Anderson were sharply critical of this aspect of the president's reaction to the Soviets, with both Dole and Crane saying that Carter had made the farmer a "scapegoat" for the failure of his foreign policy.

"Footstuffs are not a useful and appropriate tool of the foreign policy of this nation," Baker said. "We almost always starve the wrong people."

Connally and Bush were softer in their criticism, though both said they disapproved of the president's action.

Only Anderson supported the president. He chided his GOP colleagues, saying that when the first real test of leadership came, those who had criticized Carter " are unwilling to accept any measure of sacrifice."

The next question allowed the six hopefuls to explain their case for nomination. Anderson and Dole talked of their 19 years in Congress, but Bush, who left after six years to make two unsuccessful tries for the Senate from Texas, said, "I don't think being in Congress is the whole answer. I was there long enough to see how it works, but not to be part of the problem."

Dole responded, "Bush tried to be part of the problem -- but he lost that Senate race in Texas." Except for Anderson, all the candidates described themselves as moderate conservatives, blaming Democrats for inflation and other economic problems.

Asked where they differed with Reagan, the assembled Republicans used the opportunity to poke fun at the missing front-runner.

"If you want a younger Ronald Reagan with experience, I'm here," Dole said.

Connally said he didn't know where Reagan stood on specific issues and implied that Reagan's candidacy was based on the studied avoidance of issues.

Baker said that Reagan had been a good governor of California and was a worthy contender for the presidency, but he said that those who were actually competing in Iowa had a superior claim on the nomination.

Bush ignored Reagan altogther, talking instead about his own qualifications for the presidency, and Crane said he differed with Reagan only in that the former California governor favored nuclear parity with the Soviets while Crane favored U.S. nuclear superiority.

Asked how Republicans could cut taxes, increase defense spending and balance the budget at the same time, Anderson said the only way was "by mirrors." Anderson, Dole and Bush all opposed an across-the-board tax cut in 1980, a step explicitly supported by Crane. But Dole, Bush and Connally said tax cuts aimed at increasing investment and productivity were justified this year. Anderson opposed any general tax cut and repeated his proposal for a boost in gasoline excise taxes, with the funds to be used to reduce Social Security taxes.

All the candidates said limitations on the growth of federal spending and reductions in federal regulation would be the most effective steps to reduce inflation.

Responding to a question about preservation of the family farm and the growth in domestic corporate farms and foreign farm ownership, Baker and Crane used the opportunity to again attack Carter's grain embargo, which Baker called "inhumane."

Connally praised American farmers and played down the problem for foreign ownership, saying that less than 1 percent of U.S. land was owned by foreigners. Bush favored "careful monitoring" of the issue, and Dole said that the best way to help the American farmer was to put someone in the White House who understands agriculture, by which he meant himself.

Anderson called for raising target prices on wheat and feed grains and buying up more grain to make gasohol, saying that the United States could turn the present foreign policy crisis to its advantage by such a move.

Crane said he would abolish inheritance and gift taxes to help prevent family farms from being taken over by agribusiness. He is the author of legislation that would repeal these taxes.

When the candidates were asked if they want to recant any of their past words or acts, only Anderson replied in specific policy terms, saying he was sorry in retrospect he had voted for the Gulf of Tonkin resolution, which, he noted, was treated as a "functional declaration of war" in justifying the U.S. intervention in Vietnam.

When the GOP candidates were asked whether they still believed in a "special destiny" for this country, all were bullish on America.

They chose, however, to emphasize different aspects of what they saw as America's greatness, with Baker talking about the elimination of poverty and other social goals, Anderson emphasizing the need to build a more peaceful world and Dole saying the United States could "feed and clothe the starving of the world -- and they are many."

Crane and Connally talked in general terms about the "goodness" of America, with Connnally adding that the United States was the hope of freedom in this world."

And Bush emphasized the U.S. role in serving as both the symbol and substance of freedom to other nations.

When the subject turned to energy it became apparent that none of the others agreed with Anderson on the desirability of a 50-cents-a-gallon gasoline tax or accepted his view that the Iranian crisis provided an opportunity for Carter to seek that kind of "sacrifice" from the people.

The other five all stressed the need to encourage production of coal, oil and gas, with Connally and Crane explicitly adding that nuclear power also must be pushed.

The clearest contrast of the evening between Connally and the other Republicans came when the former Texas governor was asked about his decision to refuse federal campaign matching funds. All of the others present for the debate have said they will accept matching funds.

The absent Reagan has yet to announce a decision.

Connally, who has raised more money than any other candidate in either party, invited his rivals to reject "taxpayers' funds" and raise their own money.

But Anderson responded tartly that the money was not tax funds but came from voluntary contributions made by taxpayers when they turned in their income tax returns. Both he and Baker said that a spending limit was justifiable, and Baker contended that Connally was making a political mistake in not accepting the limit for his own candidacy.