President Reagan has found his key to Gridiron immortality: E flat.

But the Republicans' new song-and-dance man still suffered from a slight case of stage fright at the Gridiron's rehearsal Saturday afternoon, before his appearance that night in front of more than 600 of the country's most powerful journalists and politicians.

"He was a little apprehensive. I've heard him sing around a piano at home, but he'd never sung in front of an audience before," presidential tunesmith Michael K. Deaver said later. "As the president said, 'Did you ever see me in a musical?' "

In a couple of rehearsals around the piano upstairs at the White House last week, Deaver played Liberace to Reagan's Sinatra as they tried to find a musical key the president could be comfortable in. The Gridiron sent over lyrics for Reagan to consider for his surprise number called "Man ana," but Deaver said yesterday the president rejected them because they made fun of the press.

As an alternative, White House speechwriter Landon Parvin came up with lyrics that had Reagan mocking the Environmental Protection Agency, corporate income taxes, Jerry Ford and, in the grand old tradition of Washington political lampooning, himself.

More the Rex Harrison-type than a Sinatra, Reagan's voice was a little "soft" at the rehearsal Saturday afternoon, according to one observer. He needed to project a little more, Deaver told him. When Reagan seemed bothered by having to read the lyrics from a couple of typewritten sheets, Lt. Col. John Bourgeois, who conducts the Marine Band, suggested that large cue cards could be used that night.

After one run-through, Reagan seemed to be gaining confidence. Ever the showman, he suggested that the surprise would have more impact if he pulled his oversized sombrero down over his head as he trailed the conga line. Only when he reached the microphone would he tip his hat.

"It shows what great producers we are," said Allan W. Cromley of the Daily Oklahoman and Times, the Gridiron's music chairman.

By showtime, Reagan was in good voice and form and emerged from his role as caboose of the conga line having no trouble whatsoever projecting.

Reagan's appearance came about almost casually after Helen Thomas of United Press International approached Deaver with the idea not long ago. She bolstered her case by pointing out that Nancy Reagan's appearance at the Gridiron last year had been a triumph. That performance, in which she made fun of herself, became a turning point in the first lady's campaign to revamp her image. Deaver came back with the word a few weeks later that the president would go on with the show.

The only remaining question is what the Gridiron will do next year for an encore.

"I understand," said Cromley, "that the pope plays the guitar."