An auction record for an American painting was set yesterday in California when "The Jolly Flatboatmen, No. 2" by George Caleb Bingham (1811-1879) fetched $980,000 in the Beverly Hills salesrooms of Sotheby Parke Bernet.

That figure almost triples the previous record price of $330,000 earned by James Peale's "George Washington and His Generals at Yorktown" at a London auction a few years ago.

The Bingham, which is 2 feet high and 3 feet wide, shows a group of seven boatmen, partying and dancing on the bowed roof of their flatboat on the Missouri River. The Missouri painter is known to have produced at least three versions of the scene: Version No. 1. owned by Sen. Claiborne Pell (D-R.I.), has been loaned to the National Gallery of Art, where it is now on view. Version No. 3, the largest and the latest, is in the St. Louis Art Museum.

The painting auctioned yesterday - after four minutes of bidding - had been owned for many years by the Mastin family of Kansas City, Mo. Though it was sold anonymously by its California owner, exhibition catalogues record that as recently as 1968, it was in the collection of Mastin Kratz.

It was purchased yesterday - by telephone - by Stuart Feld, a partner in Hirschl & Adler's, the Manhattan gallery. "It will go into inventory just like a $5,000 painting," Feld said. "We expect someone will eventually buy it."

In the Pell painting at the National Gallery there are eight boatmen making merry. In version No. 2, there are only seven, but though they've lost a reveler, they have gained a jug.One of them plays fiddle, a second the tambourine, and a third boatman dances. In the earlier Pell picture, the dancer snaps his fingers. In picture 2 probably painted two years later, he holds, in either hand, a bandanna and a hat.

Bingham, who was born in Augusta County, Va., moved to Missouri as a child. He was a largely self-taught painter. He also was a preacher and a student of the law. Though he spent four years in Washington, working as a portrait painter, and though he visited Dusseldorf (where he painted version No. 3, he primarily is known as a painter of classically composed, light-filled Missouri scenes.

A Sotheby spokesman noted yesterday that Antiques Monthly magazine recently pubished a list of 10 "missing American art treasures," among them another Bingham river scene, whereabouts unkown. "There may be a million-dollar picture sitting around in someone's attic," the spokesman said.