The Senate Agriculture Committee yesterday approved two more major pieces of farm legislation, to help squeezed farmers repay loans and assure them higher prices for their crops.

With a crowd of visor-capped farmers filling the room and chanting in the corridor outside, the committee first voted out unanimously an emergency loan bill similar to one approved by the House Agriculture Committee on Tuesday.

Then it approved 14 to 1 a new idea, a flexible program that would permit a farmer to set his own price support level. The more land he took out of production, the more the government would guarantee him for what he did produce.

The loan program, which the Carter administration supports, would help farmers caught in a cost-price squeeze meet mortgage or operating loan repayments. It would permit established farmers to obtain low-interest loans up to $500,000. A total of $4 billion could be loaned over two years.

The bill also would increase from $300 million to $1 billion the total amount of grants available to small communities to build water and sewer systems. It would authorize the secretary of agriculture to increase the federal share of the cost from 50 to 75 percent.

The Senate committee bill to increase farm prices presumably will be offered as an alternative to a land diversion bill the same committee approved Monday.

Otherwise, farmers could get a double dip of federal money. The earlier bill would pay farmers an average of $75 an acre to take land out of production of grain and cotton. The purpose is to force up prices by cutting supply.

The bill approved 14 to 1 yesterday over evident but unspoken administration opposition would not pay a farmer to take land out of production, but to the extent that he did, the government would guarantee him a higher price for what he did produce.

The "flexible parity" proposal by Sen. Bob Dole (R-Kan.) would cost $2.8 billion more a year that present law, while the set-aside bill approved earlier would result in a net saving of about $200 million, Agriculture Department economist Howard Hjort told the committee.

Under present law the government guarantees the farmer $3 a bushel for wheat and $2.10 for corn. If prices fall below these targets, the government pays the farmer the difference. If he reduced production by 50 percent, the target price the government would meet would rise to $5.04 for wheat and $3.45 for corn, under the new bill. Loan rates - at which a farmer can "lend" his crop to the government when prices are low - would also rise.

Hjort said Dole's proposal could lead to shortages in domestic supplies and exports. Sen. George McGovern (D-S.D.) tried to change the emphasis from rewarding scarcity to simply raising price supports to help feed a hungry world, but lost 10 to 6. The only vote against Dole's bill was cast by Sen. Dick Clark (D-Iowa) who feared that increases in the price of grain would cause disastrous increases in the cost of raising livestock.

Like every agriculture committee meeting this year, the session was well monitored by farmers who have been here since January trying to get more income. As the committee debated Dole, 100 farmers in the corridor chanted "we want Dole" until Chairman Talmadge (D-Ga.) sent a policeman to ask them to be quiet so committee members could hear themselves.

When the committee approved the bill, farmers inside the room broke into applause.

Talmadge said he will try to have the Senate take up the acreage set-aside bill on Monday between debate on the Panama Canal treaties. The emergency loan bill may also come up then.

Dole told reporters after the meeting he may offer his flexible parity bill on the Senate floor as an amendment to the set-aside bill.