The capital was festooned with banners and bunting two weeks ago for the 34th anniversary of Iraq's ruling Arab Baath Socialist Party. But to all appearances the real purpose was to honor Saddam Hussein, the strong-arm ruler, self-proclaimed war hero, and more than ever the focus of an intense personality cult.

Along colonnaded Rachid Street, the main thoroughfare of old Baghdad, the walls and windows of every shop carried posters of Saddam Hussein. Some showed him holding his little daughter. In others, he was dressed in the formal regalia of a field marshal. In still others, he wore a red-checkered turban, surrounded by admirers.

"We are all with you, Saddamm," said one.

To what extent this is true, as Iraq's war with Iran drags on with no peace in sight, is of more than passing interest to foreign diplomats here as they take the pulse of Iraqi public opinion.

There is now a general conviction that the war, begun as a feud over control of the vital Shatt-al-Arab waterway, will not end without also determining the fate of both Saddam Hussein and his Iranian adversary. Ayatollah Ruhollah Khomeini, the two regional chieftains locked in a struggle for preeminence in the world's oil heartland, the Persian Gulf.

Also in conflict are two diametrically opposed revolutions -- Iraq's, dedicated to a separation of church and state, and Iran's, to the restoration of a strict Islamic society ruled by its conservative Shiite mullahs.

The atmosphere here is of supreme confidence in victory and general self-satisfaction. Many Western and Asian diplomats are giving Saddam Hussein high marks for skillful handling of the war to consolidate both his personal authority and the unity of a nation rent in the past by its ethnic and religious divisions.

Like an American politician on the election hustings, the 43-year-old Iraqi leader has been traveling tirelessly since the war broke out in September, meeting with peasants, workers, women and town officials to discuss their problems and offer advice. He has even toured Kurdistan, homeland of the rebellious Kurds, who reportedly have nonetheless provided 35,000 soldiers to the Iraqi war effort.

The Iraqi state television on April 5 provided a 90-minute spectacle of Saddam Hussein's apparently triumphal trip to Samara, close to his hometown of Takrit 100 miles north of here, just as the war was entering its eighth month.

"With our spirits and our blood, we sacrifice ourselves for you, Saddam," changed the crowds as Saddam Hussein passed through the streets.

"We all said at the start of the war, Saddam could not last three months. Well, now the war is eight months old and he looks pretty secure," remarked a Western diplomat assessing the war's effects so far on the often troubled government.

"He could come out of it pretty well -- if he doesn't blow it or become too greedy," said another referring to Saddam Hussein's threats to seize more Iranian towns and territory.

This seems to be the general conclusion right now of most within the very isolated Western diplomatic and business community here, where views are mostly impressionistic and based on fragmentary reports. Nonetheless, there was no visible evidence during a two-week visit to Iraq to contradict it.

The generally positive assessment of outsiders stationed here contrasts with those heard abroad asserting that Saddam Hussein has bungled the war, his Army has proven inept and his country become bogged down in a political and military quagmire.

That view may have overlooked some of the gains from the war to date for Saddam Hussein and his nation.

First among these has been to check the forces set loose by Khomeini's rise to power, forces that threatened Saddam Hussein's security. An Asian diplomat remarked, "The Iranians, including Khomeini, are no longer talking about taking Iraqi territory or praying in Najaf."

Najaf, 100 miles south of Baghdad, is a sacred city to Shiite Moslems, site of the holy shrine of the Imam Ali, founder of the sect. Khomeini took refuge there for nearly 15 years prior to his expulsion from the country by Saddam Hussein at the behest of the late shah of Iran in October 1978.

With slightly more than half of Iraq's Moslems of Shiite persuasion and thus susceptible to Khomeini's persistent calls for the overthrow of Saddam Hussein, stemming the ayatollah's revolution was of prime importance to the survival of the Iraqi government and the war a vital test of strengths between nationalist and religious allegiances.

The Iraqi leadership insists that the government and country have passed the test with flying colors.

"Iraqi nationalism was not put on exercise for centuries the way it was in this war," said Tariq Aziz, a leading member of the ruling Revolutionary Command Council, in an interview.

"It went through the exercise successfully, strongly. . . . Everybody's thinking like an Iraqi. [The nation] is not thinking out of the divisions according to which so many forces wanted to picture Iraq -- Arabs and Kurds, Moslems and Christians, Shiites and Sunnis. This is a great achievement for a developing country."

Despite some rumblings of renewed opposition activities in Kurdistan and a few rumors of isolated instances in Basra on the Shatt-al-Arab involving Shiites, outsiders here tend to agree with Aziz -- particularly as compared to the ethnic strife tearing apart Iran.

"I think the Iraqi Shiites feel more Arab and Iraqi than Shiite, more a part of Iraq than Iran," said an Asian diplomat.

Another Iraqi gain from the war -- as seen from here if not from abroad -- has been in self-confidence of the previously untried Army after its occupation of 6,000 to 8,000 square miles of Iranian territory and success in turning back a number of much-touted Iranian counteroffensives.

Officers at the southern front near Abadan compare the Army's overnight crossing of the Karoun River with tanks and heavy armor in October to the successful initial Eyptian blitz on Israeli lines across the Suez Canal in the 1973 war. They also point to what they describe as the biggest tank battle in the Middle East since World War II -- around Susangerd in early January, ending in the Iraqi capture or destruction of nearly 300 Iranian tanks, according to Iraqi accounts.

But perhaps the most notable Iraqi achievement in the eyes of outsiders here is that an Arab army for the first time in modern history has proven capable of organizing and sustaining a war, involving an occupation army of 100,000 troops, for eight months without a major upheaval in the nation's life.

"Their ability to keep the war going, their logistics, is pretty impressive," remarked one Western analyst.

Triq Aziz cites only gains for Iraq from the war outside the loss of life -- "an average of 10 to 20 every day" -- which he compared favorably to the toll in Iraq from traffic accidents. "Everything in this war is positive," he said.

"The war has stimulated all the instincts and capabilities of the Iraqi people for courage, invention and development which is very important for developing countries," he added.

Among the main claims Aziz listed were Iraq's use of its civilian industrial base and technical ability to produce "70 to 80 percent" of the spare parts needed by the Army; a vast improvement in the distribution of supplies; the diversification of foreign arms sources, thus ending dependence on the Soviet Union, and the overtaking of Iran in the field of economic development.

Despite the aura of enormous accomplishment and self-satisfaction, the war is far from over yet and the toughest months lie ahead for Iraq and Saddam Hussein. With no sign of any Iranian willingness to compromise and mediation efforts seemingly going nowhere, Saddam Hussein faces some tough decisions about what to do next.

Saddam Hussein has made the war his greatest claim to Iraqi, and Arab, fame and leadership, so much so that it has been officially dubbed "Saddam's Qadisiyah," a reference to the decisive Arab victory in 636 over the Persians at the town of Qadisiyah south of Baghdad, helping define what is now Iraq.

But unlike in that ancient battle, the Iranians have yet to be so thoroughly routed in their own Khuzestan Province. They still hold the island and city of Abadan, making it impossible for Saddam Hussein to enforce his claim of Iraqi sovereignty over the Shatt-al-Arab.

He has threatened a new offensive, the taking of more Iranian cities and greater efforts to provoke the dismemberment of Iran. But all these steps involve enormous risks for Saddam Hussein, including the likelihood of high casualties among his troops and a consequent stirring of discontent.

Western analysts say the war has consolidated Saddam Hussein's ties with the military. But a major setback could undo this and set the Army against him.

"The question is, can he politically afford to escalate the war?" asked one Western analyst.

Even another battle victory could prove illusory, in the view of some war analysts here.

"If the Iraqis could knock out Dezful [in northern Khuzestan], it would give them enormous advantage in that sector, but they can't move on to Tehran," said one. "They would win the battle but not the war. That is the dilemma for them, and that's why they are so keen on a peace settlement."