Robert S. McGarry, the top executive for the sanitary commission that serves Montgomery and Prince George's counties, confirmed yesterday that he will be quiting that post when his contract expires in May.

McGarry, general manager of the Washington Suburban Sanitary Commission for three years, said he was frustrated by the constant fighting between the two counties that has produced a stalemate on every major issue before the agency.

"When I decided I did not want to stay and fight, I decided to withdraw," McGarry said yesterday. "My decision is firm. I will be job hunting now." m

McGarry's decision also was apparently motivated by reports reaching him recently that the Prince George's County government felt he was not responsive enough to heir interests and directives, McGarry's associates said yesterday.

"Of course I have not been biased, the former general said yesterday "But I certainly see how it could be perceived. We have been working pretty hard to solve some problems in Montgomery and some Prince George's people felt that showed bias. And we worked hard in Prince George's and Montgomery people were upset."

McGarry's decision came as a surprise to many county officials and added to worries that the WSSC will not be able to continue much longer functioning as a bicounty agency.

"Bob McGarry has been the only glue holding the gum works together," said state Del. Timothy F. Maloney (D-Prince George's). "The tiolets will still run without him and the water come out of the sink, but it's just another leak in the sinking ship."

In the last 10 years, Prince George's and Montgomery have argued about water and sewer issues as they completed increasingly for development. The WSSC is run by six commissioners, three appointed by each county government.

Over the last nine months, the feuding has become severe enough to stop decision-making on such crucial issues as budget priorities, rate increases, sludge plants and sewer capacity. On each issue, the commission has been split along county lines.

"There have always been conflicts, but the lights have never been like this," said commission chairman David Scotten. "They agency is in disarray, morale is at an all-time low. It does look like the beginning of the end as a bicounty agency."

The possibility of splitting the WSSC into two separate county water and sewer departments has been studied several times in the last 10 years, but none of the resulting recommendations have ever been acted on.

Part of the problem, according to state legislative officials who must approve any changes in the WSSC, is that much like the WSSC commissioners, Prince George's and Montgomery delegations do not see eye to eye on the water and sewer issues affecting the two counties.

"Any bill on the WSSC we pass Montgomery County vetoes and vice versa. It's like the Berlin Wall," said Maloney. "What we're going to have to do is sit all the players down and work it out because people have been just pointing the finger at each other."

Despite what McGarry, Scotten and others agree are "serious differences" between the two counties, county officials point to recent meetings between the leadership of the two county councils as a sign that compromise still is possible.

"I have every expectation that these issues can be resolved," said Prince George's council administrator Samuel Wynkoop. "These impasses have always occurred and are solved with a little patience, hard work and ingenuity."

Said Montgomery County administive officer Robert Wilson, "I think the thing will work out. It's unfortunate that McGarry is leaving but maybe that will change, too."