U.S. Ambassador Vernon A. Walters said yesterday he is optimistic that his recent discussions with Syrian President Hafez Assad will result in some movement affecting the fate of hostages held in Lebanon.

Walters met with reporters after briefing President Reagan on his recent around-the-world trip and discussions with members of the U.N. Security Council on a cease-fire resolution on the Persian Gulf.

The U.S. ambassador to the United Nations met with Assad July 5-6. He said their discussions dealt with the hostages, halting terrorism and achieving a Middle East peace.

"I asked him to do everything he could to bring about the release of these hostages, and said he would have a positive impact in the rest of the world if he could find a way to do something," Walters said. "He said he would try and see what he could do."

Asked if there is hope for the future of the hostages, he said, "Yes, I think there is."

On whether he believed Assad had enough influence in Lebanon to achieve the release of the hostages, the ambassador said, "It's a question whether he can locate them through the intelligence and do something about it."

The ambassador said he "asked for all the hostages, not just {journalist Charles} Glass . . . the French, the British, the Germans, the Italians . . . ,' " the ambassador said.

Later, White House deputy press secretary Dan Howard said the ambassador asked him to tell reporters that he did not intend to give the impression that his reference to a "couple of weeks" indicated any definitive deadline.

In all, 26 foreigners are known to be missing in Lebanon. There are nine Americans, six Frenchmen, three Britons, two West Germans, an Italian, an Irishman, a South Korean, an Indian and two foreigners who were seen being abducted but have not been identified.

The longest-held foreign hostage is Terry Anderson, the chief Middle East correspondent of The Associated Press, who was seized March 16, 1985.