Farmers now can control the gender of calves born to their cows, and sex control technology is advancing so rapidly that it soon could be used widely to select the gender of human infants, scientists here said today.

Until this year, no technique to control the sex of human or animal infants was proved to be successful, said George E. Seidel of Colorado State University.

But the first sex-controlled pregnancies in cattle are in progress and the first births are expected later this year, he said in a panel discussion at the annual meeting of the American Association for the Advancement of Science.

The method, if it becomes widespread and relatively inexpensive, could be worth $400 million to farmers who raise cattle, sheep, swine and poultry, said Robert H. Foote, of Cornell University.

Until now, a dairy farmer had to accept that roughly half the calves born in his herd--the bulls--were useless as milk producers and must be sold at birth. With beef cattle, males grow more rapidly and thus are more profitable. There are similar advantages to one gender over another among other farm animals.

In humans, many methods for increasing the likelihood of producing children of a desired sex have been offered over the centuries, but now scientists say gender control of human offspring may be very close.

In fact, Dr. Ronald Ericsson of Sausalito, Calif., has begun offering a sex control service and has franchised his technique to other doctors in this country and abroad.

The four scientists on the panel said that Ericsson's method has been tested in cattle and failed but that some unconfirmed reports show it may work in humans, producing boys 75 percent of the time instead of the usual 50 percent.

Social psychologist Roberta Steinbacher of Cleveland State University said gender control would raise ethical and social questions. If the number of males far exceeds that of females, she added, society could face increased crime, violence and widespread homosexuality.

Steinbacher cited estimates that the ratio of men to women in the United States might be as high as 140 to 100, and in India as high as 186 to 100, if sex control is used widely.

But she said her own work suggests these numbers are exaggerated. In a 1982 study of 240 expectant mothers, she found the women did not have a strong preference as to the gender of their infants, and among those who did and who would use sex control techniques, exactly half wanted boys and half wanted girls.

The animal technique that has been proved in laboratory work was offered by at least one company, Genetic Engineering Inc., of Denver, beginning last month. It involves first injecting a cow with fertility drugs to produce more eggs than usual. The eggs are fertilized by artificial insemination and after six days are flushed out of the womb.

The sex of each embryo is determined by adding a fluorescent protein molecule that attaches itself to a molecule only on male embryos. On film, the male embryos glow and can then be separated out. Male or female embryos may then be implanted in a cow's womb to be carried to term.

Each successful sex-controlled calving now costs $900, but the price is expected to drop over the next few years.

The chief method of sex control being tested in humans involves the separation of sperm that have an X and a Y chromosome--a male combination--from ones with two Ys--female.