President Reagan welcomed the sultan of Oman to dinner last night at the White House, capping a marathon day of discussions about the Middle East.

Afterwards, over coffee in the Blue Room, Sultan Qaboos Said expressed cautious optimism that "there must be a way" to get Reagan's peace initiatives back on track.

"I'm a great friend of King Hussein's, of course," the sultan said. "We always discuss things to exchange our views and I hope to see him on my way back to Oman next month."

Wearing a gold-embroidered black robe and a headpiece called an "amamh," the sultan told reporters the Israelis "should stop the settlements" on the West Bank and "should pull out of Lebanon as soon as possible." Before he could go on, a U.S. security aide moved in and told him the president was waiting. The president, however, was talking to opera star Robert Merrill, who sang at the Yankees' home opener in New York earlier in the day.

"He said, 'I hope you didn't leave your voice in Yankee Stadium,' " said Merrill, who has sung for eight presidents and at least one presidential daughter.

"Amy Carter loved my 'Figaro.' I also sang it for President Johnson's first state dinner," said Merrill. "Lady Bird explained it to him before I sang it so he'd know what the hell I was singing."

While the sultan waited nearby, Reagan also talked with artist Andrew Wyeth, who had already inspected the new Herbert E. Abrams' portrait of Jimmy Carter--"I don't think it's bad," said Wyeth, who didn't care for the Alexander Clayton portrait of Richard Nixon. "It's not good."

But it was clearly Ronald Reagan's movie career that fascinated Wyeth. "The way you ride that horse!" Wyeth said of the president's performance in an early movie.

"That's my specialty," said Reagan in his best aw-shucks manner.

Wyeth said Reagan also was "terrific" in "Dark Victory," a role in which he was cast as a "ne'er-do-well," as the president himself later described it. "I had to act like crazy to play that part. I wasn't type-cast."

Because the Omanis as Moslems don't drink alcohol, champagne toasts were dispensed with and instead, in an atmosphere of cordiality, Reagan and his the sultan traded "remarks." They complimented each other's leadership qualities and renewed pledges of mutual support.

"We are under no illusions," the sultan said. "We realize the importance of the geo-political position we occupy at the mouth of the Persian Gulf. And unstable conditions make it imperative we develop our country.

"We don't expect others to shoulder our burdens for us," he added. "We can fight our own battles."

The sultan's remarks apparently alluded to the continuing tensions in the Persian Gulf region brought about by the bitter war between the oil-producing countries of Iran and Iraq.

"We revere your personal courage and commitment," Reagan said in expressing his "high regard" for his guest. The president also lauded Oman's achievements in modernizing education and upgrading health facilities.

The all-male Omani delegation made a colorful, impressive sight in the White House state rooms. Some wore gold spurs that jangled, and almost all of them, except the sultan, wore silver or gold daggers tucked in their waistbands.

Attending the dinner was a cross-section of celebrities, from heart specialist Michael De Bakey to fashion designer Calvin Klein, who exchanged kisses and hugs with Nancy Reagan. Others attending included pianist Byron Janis and his wife Maria, who is Gary Cooper's daughter; Richard McKenzie and his wife, Ava, who is Fred Astaire's daughter, and Leonard Silverstein, president of the National Symphony Orchestra. Ethel Merman sent regrets at the last moment because of illness.

On the dance floor after the sultan returned to his hotel, NSO's Silverstein patted his breast pocket, then pulled out a check for "$300,000 only," drawn on the British Bank of the Middle East. "This is a good precedent," said Silverstein of the check from the sultan to endow a Nancy Reagan chair for narrative music. "When other leaders come to Washington they can drop off a little something, too."

The Reagans saw the sultan off at the North Portico, protected from the gaze of passersby on Pennsylvania Avenue by huge white canvas "curtains." Inside the White House, the Marine Band struck up "Shall We Dance?"--and the Reagans did. A little later, just before the president and first lady went upstairs, the band played "Second-Hand Rose," and Nancy Reagan went into her 1982 Gridiron Club routine, kicking up her heels and flipping the skirt of her red Galanos evening gown.

Opera stars Anna Moffo and Merrill entertained in the East Room, singing numbers from "Madame Butterfly," "The Barber of Seville" and the familiar songs of Franz Lehar and George Gershwin.

The dinner menu included Columbia River salmon with green sauce, supreme of chicken with mushrooms, curried rice, fresh asparagus, endive and watercress salad, cheese and sherbet. The wines included Mesa American State Chardonnay 1980; Mill Creek Merlot 1979; and Domaine Chandon Blanc de Noirs.

Earlier in the day, the sultan met with Reagan for 90 minutes and discussed the troubled Middle East peace proposals.

He then went to a lunch at the State Department, where he met with Secretary of State George P. Shultz. Elsewhere in the room were the secretary of defense, White House and State Department officials and American business leaders.

"We know that you and other Arab leaders of vision and moderation share our concern that King Hussein's patience and determination over the past few weeks have not brought us the broadened negotiations essential to progress," Shultz said.

"The Arab world must, in the end, sit down with Israel and work out a just peace. As has happened all too often in the Middle East, radical elements have once again temporarily frustrated the deep hunger of all people of the region for that just and lasting peace. The chief victims of that policy of obstruction and rejection are the Palestinian people themselves . . ."

According to his official biography, the 42-year-old sultan became ruler of Oman in 1970 after his father resigned and went to live in England. The White House biography of Sultan Qaboos Said, released yesterday, put it a little differently. "He became sultan by overthrowing his father," it said.

The State Department luncheon was the first look at the sultan's entourage, who wore flowing black ceremonial robes called "beshets" that almost but not quite concealed their menacing curved blades. To some of the 150 Foggy Bottom guests, the effect was, well, sobering.

No, no, no, insisted the Omani ambassador, sipping Catawba grape juice, White House security had been no problem at all. The Omanis simply told the Secret Service that they always wore a "khanger," or dagger, with their robes.

"They know who we are,"said Omani Ambassador Ali Salim Hinai said.

It hadn't been quite that easy when he and his wife, Thuraya, with their three children, flew to the United States last month from Oman. He had put his dagger in his briefcase, but when it went through airport X-ray, security officers saw it.

"They said, 'Please, we know you are an ambassador, but we can't let you have it with you.' So I handed it over," he said.

When he reached London, he didn't see anybody from the airline to return the khanger at first, so "naturally," he said, he became worried. "It's very expensive, you know--about $2,000," he said.

In London, he decided to pack the dagger in his suitcase. Concerned that the airline would lose the suitcase, he made sure it went aboard his plane. What he didn't realize was that the plane was stopping in New York before continuing on to Washington.

"My heart pumped, pumped," the ambassador said. "My wife asked 'Why are you so unhappy?' I said 'Where is my khanger?' "

It had been on the plane all the time, of course, and arrived in Washington at the same time as Hinai. But he began worrying about what he would do when he has to return on business to Oman, where he needs his ceremonial robes and dagger. So the other day, Hinai called his brother in Oman.

" 'Buy me another khanger,' I said, 'and keep it for me there,' " said the ambassador.

Hinai's solution drew a nod from Rep. Bill Alexander (D-Ark.).

"It's like having two suits," said Alexander.

Guests at President and Mrs. Reagan's state dinner for the sultan of Oman last night at the White House:

Sayyid bin Fahad, deputy prime minister for legal affairs

Sayyid bin Faisal, minister of national heritage and culture

Yousef Al-Alawi Abdulla, minister of state for foreign affairs

Gen. Ali Majid Al-Maamri, first aide-de-camp to the sultan and president of the palace office

Ali Salim Al-Hinai, Omani ambassador to the United States

Sayyid Saif bin Hamed, deputy president for royal protocol affairs

Dr. Omar Al-Zawawi, special adviser to the sultan

Lt. Col. Malik Sulaiman Al-Maamri, aide-de-camp to the sultan

Maj. Abdullah Saif Al-Abri, aide-de-camp to the sultan

Brig. Gen. Timothy Landon, adviser to the sultan

Gen. Geoff Harcort, adviser to the sultan

Mahmoud Aboul-Nasar, Omani ambassador to the United Nations

Sir Timothy Creasey, adviser to the sultan

Dr. Shirley L. Abbott and Arline Abbott, El Paso, Tex.

Mohamed Sulaiman Al Tai, editor-in-chief, Al-Watn

Robert B. Anderson, former secretary of the Treasury, and his niece, Larisa Vanov

John Duke Anthony, American Educational Trust

Justice Harry M. Blackmun and Dorothy Blackmun

Thomas Buestrin and Mary Buestrin, Mequon, Wis.

Mary (Cissy) Cahan, New York

William P. Clark, assistant to the president for National Security Affairs, and Joan Clark

Sen. Thad Cochran (R-Miss.) and Rose Cochran

John R. Countryman, U.S. ambassador to Oman

Lester L. Cox and Claudine Cox, Springfield, Mo.

Lt. Gen. James E. Dalton, director of the joint staff, and Betty Dalton

Sen. John C. Danforth (R-Mo.) and Sally Danforth

Marjorie Deane and her son, Disque Dean Jr., New York

Deputy Chief of Staff Michael K. Deaver and Carolyn Deaver

Dr. Michael De Bakey, Baylor College of Medicine, and Katrin De Bakey

John Fairchild, chairman of Fairchild Publications, and Jill Fairchild

Rep. Thomas S. Foley (D-Wash.) and Heather Foley

Thomas Gleason, president, International Longshoremen's Association

Stephane and Lillian Groueff, Washington, D.C.

Secretary of Energy Donald P. Hodel and Barbara Hodel

Walter and Jane Hoving, New York

Rear Adm. Jonathan T. Howe, director, Bureau of Politico-Military Affairs, Department of State, and Mrs. Howe

Michael Hudson, director, Center for Contemporary Arab Studies, Georgetown University, and Vera Hudson

John N. Irwin II, former ambassador to France, and Jane Irwin

Byron Janis, concert pianist and Maria Janis

LeRoy and Vermont Jeffries, Los Angeles

Calvin Klein

John D. and Hazel Marsh, Gainesville, Va.

Ann Devroy, Gannett Newspapers, and Mark Matthews

Rep. Joseph M. McDade (D-Pa.)

Richard and Ava McKenzie, Lumberville, Pa.

Presidential counselor Edwin Meese III and Ursula Meese

Robert Merrill, opera singer, and Marion Merrill

Thomas S. Murphy, chairman, Capital Cities Communications Inc., and Suzanne Murphy

Chester A. and Dorothy Nagle, Washington, D.C.

John E. Peterson, College of William and Mary

Duarte Pinto-Coelho, Madrid

James and Pascal Regan, Beverly Hills

S. Dillon Ripley, secretary of the Smithsonian Institution, and Mary Ripley

Selwa Roosevelt, chief of protocol, and Archibald B. Roosevelt Jr.

Lewis Rudin, New York

Anno Moffo, opera singer, and her husband, Robert W. Sarnoff

Richard Mellon Scaife, publisher, Tribune Review Publishing Company, and Frances Scaife

Dr. Cory SerVaas, editor and publisher, Saturday Evening Post, and her husband, Dr. Beurt SerVass

Secretary of State George P. Schultz and Helena Shultz

Leonard L. Silverstein, president, National Symphony Orchestra Association, and Elaine Silverstein

Dr. J.R. Spencer and Kae Spencer, Templeton, Calif.

Robert T. Thompson, chairman, U.S. Chamber of Commerce, and Elaine Thompson

Nicholas A. Veliotes, assistant secretary of state for Near Eastern and South Asian Affairs, and Mrs. Veliotes

Andrew Wyeth and Mrs. Wyeth

Sen. Edward Zorinsky (D-Neb.) and Cece Zorinksy