The House and Senate Agriculture committees decided yesterday to get off the dime in writing new farm legislation as the Reagan administration warned that costs will soar again next year if changes are not made in the programs.

Under pressure from Majority Leader Robert J. Dole (R-Kan.), who lectured on the political costs of further delay, the Senate panel voted to finish its work on a farm bill by July 15, a goal that struck most as overly optimistic.

House committee leaders, meanwhile, agreed to devote the week of July 8 to a full-scale markup of their bill.

Dole said that he and legislators from other wheat states would find it "hard to go home" for the August recess if Congress has not written a bill telling farmers what kind of support program will be available as they prepare to plant their winter wheat.

The Senate committee's setting of a deadline prompted Agriculture Secretary John R. Block to announce postponement of a July referendum among wheat farmers to decide if they want strict production controls.

The vote is required under permanent law that would prevail if a new farm bill is not enacted by Sept. 30.

The deadline means that the committee will have only one week after its July 4 recess to finish work on a measure that has kept it hopelessly divided for months. Chairman Jesse Helms (R-N.C.) offered to stay through the recess and work if others would follow suit, but he got no takers.

Sens. John Melcher (D-Mont.) and Rudy Boschwitz (R-Minn.) complained that work had been held up by the Agriculture Department's inability to produce more accurate and timely crop production and program cost estimates.

Robert Thompson, assistant secretary for economics, conceded that the estimates for fiscal 1986 program costs are "absurdly low," but he said they were the best available for now.

Thompson said that falling exports and a prodigious grain harvest expected this fall could add between $2 billion and $3 billion to program costs and put them close to 1983's record high of $18.9 billion.

But Thompson contended that the USDA's current figures were tailored after Congressional Budget Office computations. "The CBO uses your model. Don't tell me to go to the CBO," Boschwitz said. "We've been there."

Boschwitz chided Thompson for using "wrong numbers and wrong assumptions," which he said would lead to "bad policy and not serve agriculture in the coming years . . . . These are bad numbers. I find these numbers outrageous, in fact."