President Reagan said today that while he has a "personal dream" that he will see the day of a balanced federal budget and some payments on the national debt, "deficits continue to loom in the future, clouding the confidence we must have in the recovery."

His acknowledgement of looming deficits, less than two weeks before his fiscal 1984 budget is to be submitted to Congress, came on a day marked by contrasts for Reagan, who promised during his 1980 campaign to balance the budget and often has pledged not to interfere in a Republican primary contest.

The contrasts were evident as Reagan made a return visit to hail the progress of Providence-St. Mel High School, located in a poverty-torn black neighborhood on Chicago's West Side, where private business has made contributions and students have excelled in what the president described as an "inspirational" example of cooperation.

When he came to the school last May 10, Reagan took questions from students in a free-wheeling exchange during which he asserted confidently that he is making progress against deficits.

He said then that the 1984 deficit would be $69 billion and that the budget would be balanced a few years after that.

"Check me out," he insisted to the student audience in that meeting last spring. "Make sure what I told you checks out and is true. . . . Don't be the sucker generation."

Reagan's seven-minute appearance at the school today was arranged to avoid difficult questions about the economy, as deficits soar $100 billion or more beyond the estimate he made just eight months ago.

Instead, the president cheerfully recalled his days as a baseball radio announcer and repeated his assertion that "scads of pages" of help-wanted advertisements in newspapers show "there are jobs out there that are going unfilled simply because people have not been trained to fill them."

He also took another jab at unauthorized White House disclosures to the press. Told that the aging brick school had a leaky roof, Reagan said while talking with school directors in the basement cafeteria:

"I hope when you get it fixed, if you learn anything in fixing it that could help us with some leaks out of the White House, I would be glad to hear how to do it."

Reagan began the visit in an advanced computer class by sitting in front of a terminal programmed to greet him when he pushed keys.

He also answered pre-programmed questions on the terminal such as, "Who's the Senate majority leader?" Reagan's answer was Sen. Howard H. Baker Jr. (R-Tenn.), and "hooray" flashed on the screen.

He told a reporter that the decline in the gross national product disclosed today was not "much of a surprise" and "a large part of that is due to shrinking inventories."

Talking a few minutes later about the importance of science education, Reagan, who made rising unemployment a chief campaign target, said it is not as easy to bring down the jobless rate.

"Some think that it just takes a magic wand, but nearly one-fourth of our unemployed never had a job or are just entering the job market for the first time. Many are willing to work. But they lack the skills in a fast-changing economy that is geared more and more to computers," he said.

The school visit was part of a continuing White House effort to combat the perception that Reagan is insensitive to needs of minorities and the poor.

It was arranged so Reagan would tour the school before the television network's evening newscasts and then appear at an evening fund-raiser for Senate Foreign Relations Committee Chairman Charles H. Percy (R-Ill.).

Reagan's remarks at the fund-raiser indicated his awareness of the large deficits: "A high priority must be to get a hammerlock on this monster known as the federal budget. Deficits continue to loom in the future, clouding the confidence we must have for recovery. We must not allow gaping deficits to block the economic growth that alone can bring lasting recovery."

In contrast to his pledge to balance the budget by 1984, Reagan said tonight only that "those budgets must move steadily toward the day when they are balanced."

Reagan's pledge not to interfere in GOP primaries was being tested by party conservatives. He had committed himself to speak at the Percy event, but many conservative activists were pressing him to attend a rival fund-raiser in the same hotel tonight for Rep. Tom Corcoran (R-Ill.), who is expected to challenge Percy in 1984