Occidental Petroleum Corp., the giant oil and gas company, announced today that it has reached an agreement in principle to merge with the nation's biggest beef slaughter, Iowa Beef Processors Inc.

Stockholders of Iowa Beef would receive shares of Occidental common and preferred stock under the terms of the proposed deal. Based on Occidental's closing price last Friday, the companies said, Iowa Beef shareholders would receive about $77 worth of Occidental common and preferred stock for each share of Iowa Beef common stock. The total value would be about $800 million.

Oxy stock fell one point to 28 yesterday, while Iowa Beef stock soared 6 3/4 points to 65 1/4 on the New York Stock Exchange.

According to the companies, if the deal is not closed within four months, either side has the option to terminate the proposed merger. Furthermore, Iowa Beef can kill the merger if Occidental stock falls below $25 a share in the 10 days before the closing date, and Occidental can back out if its stock rises above $33.

A spokesman for Occidental, the 20th-largest industrial company in the United States, with sales of about $12.5 billion, said that while the company derives most of its revenues from oil and gas, it also is involved in the agricultural area, primarily in the manufacturing of pesticides.

But Occidental also does some cattle breeding, and one of its subsidiaries is developing a hybrid rice for the People's Republic of China. According to the company's 1980 annual report, Occidental last year sold $1.08 billion worth of agricultural chemicals.

A spokesman for Iowa Beef Processors, which last year had sales of $4.6 billion and was the 81st-largest industrial company, said that Occidental Chairman Armand Hammer first approached Iowa Beef officials about the merger last week.

Hammer and Iowa Beef cochairman Robert L. Peterson and Dale Tinstman flew to Los Angeles on Friday. Saturday, they presented the plan to Iowa Beef's board of directors at a regularly scheduled meeting.

Iowa Beef pioneered the concept of boxed beef, doing much of the butchering at its own plant, then shipping 80-pound boxes of cut beef to supermarkets, restaurants and hotels. Before boxed beef caught on, supermarket chains generally bought whole or half carcasses, complete with bones and fat, and cut them up into steaks and roasts.

Iowa Beef will operate as an independent subsidiary of Occidental, Hammer and Peterson said in a statement.

Occidental's Hammer, who is a well-known art collector with close ties to the Soviet Union, has become increasingly interested in food and nutrition, a spokesman for Occidental said. In a recent speech, Hammer said that there can be no world peace until all human beings are well-fed, and that during the decade of the 1980s there must be a major increase "in the food production capability of this planet."

Occidental officials said they think that the oil giant's worldwide distribution network should open up export markets for the beef processor, especially in Europe.

Occidental is based in Los Angeles, Iowa Beef is in Dakota City, Neb., just across the state line from Sioux City, Iowa.

Nearly 75 percent of Occidental's revenues last year came from oil and gas operations -- exploration, production and marketing -- while another 20 percent came from chemicals. One of its major subsidiaries, Hooker Chemical Co., has gained national notoriety from the situation at Love Canal in upstate New York, where the company has been accused of storing toxic wastes that polluted the surrounding area.

Last year Iowa Beef earned $53 million on $4.6 billion in sales, while Occidental Petroleum had profits of $710 million on $12.5 billion in revenues. If the merger is completed, the combined company would vault to 15th place among U.S. industrial companies, right behind Conoco Oil, based on 1980 sales.