NEW YORK, FEB. 8 -- After a six-month public flirtation with the idea of running for the Senate, U.S. Attorney Rudolph W. Giuliani said today he would pass up the race to pursue investigations of corruption on Wall Street and elsewhere.

Giuliani's handling of the decision angered some New York Republicans, who were left without a candidate to challenge Sen. Daniel Patrick Moynihan (D-N.Y.) less than nine months before the November election. But it delighted aides to Moynihan, who is virtually assured of winning a third term without serious opposition.

Giuliani has said repeatedly that he would not leave the U.S. attorney's office in Manhattan if he felt it would jeopardize ongoing investigations into insider trading, organized crime and public corruption.

"It would be wrong for me to leave this office now, whatever the allure of another office or opportunity, because, I believe, it would adversely affect some very sensitive matters still in progress," Giuliani said today. ". . . I felt I hadn't finished a job it was my responsibility to do."

Giuliani had angered a key ally, Sen. Alfonse M. D'Amato (R-N.Y.), by virtually demanding that he be allowed to choose his successor. The prosecutor said last month that he would run for the Senate, but only if D'Amato asked the White House to name a successor acceptable to Giuliani within two weeks.

Despite Giuliani's preference that the job go to a top deputy, D'Amato made clear that he would not be rushed and asked a selection panel to begin interviewing candidates. D'Amato received no advance word of today's announcement.

"Some people believe Giuliani might have been scared off by the fact that he would've had trouble beating Moynihan, and that his demand that his replacement be handpicked by him was a graceful way out," one Republican said.

"This little playing around didn't do anybody any good. I don't think it's very fair to the party. It doesn't give the Republicans a hell of a lot of time to find a nominee."

Giuliani said he always made clear to party officials that "this job came first," and he dismissed suggestions that he was afraid to challenge Moynihan. He said polls indicated that he was very popular in Democratic New York City and less well known in upstate areas that are traditionally Republican.

But Moynihan pollster Doug Schoen said a poll conducted last weekend showed Moynihan beating Giuliani 58 percent to 25 percent. The poll was taken just after Moynihan, who expects to raise $5 million, took to the airwaves with a series of reelection ads.

Liz Moynihan, the senator's wife and campaign manager, said the January commercials put to rest "any speculation" that her husband "wasn't prepared to fight a hard fight."

"If I were Mr. Giuliani, I'd have taken a close look at those poll figures and I would have decided to remain U.S. attorney or become a rich attorney," she said.

Some observers have questioned how Giuliani, who has enjoyed a favorable press, would react to the rough-and-tumble of a campaign and raise adequate funds.