When Jimmy Carter wanted the country to have an emergency plan for gasoline rationing, John Buckley and other government specialists answered their president's call.

Now Buckley works for Ronald Reagan, a president who opposes the whole idea of gas rationing. So, come Sept. 30, the 38-year-old computer systems developer and more than 30 other Department of Energy employes will be out of jobs they took with the Gasoline Rationing Preimplementation Project Office, which is being abolished.

The gasoline rationing planners, most of whom left protected positions elsewhere, are being laid off along with some 4,400 nonmilitary government workers here, all victims of the Reagan administration's bydget and program reductions. But they feel their fate has an added ironic twist.

"The thing that bothers me is that we were actively recruited," said Buckley. "Many of us were asked to come over from other offices, and we were told we could get our jobs back."

Carol Rich, for example, worked as a secretary for the Interior and Energy departments for six years before transferring to the gasoline rationing office after it was formed a year ago last April, amid concerns that the long gas lines of 1974 and 1979 could occur again. She was looking forward to building a career in government, not losing one.

"We knew the jobs setting up the rationing system were not permanent, but we expected to be relocated in other DOE offices or kept on to manage the readiness program," said Rich, 32. She had been doing more than secretarial duties for the gas rationing program and still hopes to find nonsecretarial work.

But, for the two of them and most of the other gas rationing staffers, job-hunting experiences so far have been bleak. Their difficulties are compounded because the gas rationing office has been designated its own "competitive area, " which in civil service lingo means its employes have no retention rights ant therefore no competitive edge that would allow them to move into other jobs in the department.

Employes who were detailed or loaned out from other offices should have some claim to their old jobs, said another DOE official, Charles Tierney, deputy assistant for organization and management. But once they officially hired on for gas rationing duties, as nearly all did, their job commitment was for that office alone, he said.

"The budget cuts all around make it awfully hard to find spots for anyone," said Tierney. "We can't speak to what any individual supervisors may have promised" about job security, he added, by any commitments would have exceeded their authority.

Jeremy Black, a DOE career counselor detailed to the gas rationing office as a management systems specialist, has been busy the last several weeks preparing job-hunters, including himself, for what he says are hard times ahead.

"The agency has really tried to reassign people, but there just won't be that many places to go," said Black, who, at 36, has already spent 10 years in government service. He has been helping gas rationing office colleagues prepare resumes and identify potential new employers.

The Energy Department has its outplacement counselors trying to locate new jobs with other agencies or the private sector, and the department has also contracted with a personnel consultant to hold a 20-hour seminar that takes a hard look at the skills people need to make job transitions.

"It's frightening to go job-hunting in a situation like this," said Black. "You need a very, very positive demeanor in the best of circumstances, and with what you have going around here, it's very hard to have that positive attitude."

Buckley, for instance, has applied for about 30 government jobs so far and gone on five interviews, then watched the slots be filled by people from inside the agencies where he applied. But he wants to stay with government service, which he joined three years ago after eight years in private industry, because he believes he has good skills to contribute.

"I've got my name on every job referral list I'm eligible for, and I'm sure I'll be successful eventually," said Buckley , who has two children and another on the way. "But it's tough now."