Even before Salvadoran President Jose Napoleon Duarte learned he was suffering from cancer, the Reagan administration was concerned that the special relationship it had forged with El Salvador under Duarte's leadership could begin to wane.

Duarte has been a favorite of Republicans and Democrats alike in the Congress, and since his election four years ago, El Salvador has received $1.5 billion in U.S. economic aid and $455 million in military aid, levels unmatched elsewhere in Latin America.But Duarte's Christian Democratic Party is deeply split, raising the clear possibility that victory in the 1989 presidential elections may go to the rightist ARENA party, which made a strong showing in legislative elections last March.

Many in Congress are wary of ARENA because of the party's reputed links to death squad activities, and there is some doubt among State Department officials about whether the lawmakers will be as generous with an ARENA-run government as they have with Duarte.

Duarte was already a lame duck president when, according to U.S. officials, he learned that the cancer whichhas affected his liver and stomach is terminal.

"The only question is how long he will live," said one official, adding that his survival may only be a matter of months. Spokesmen at Walter Reed Army Hospital, where Duarte has been confined since Wednesday, have discussed Duarte's condition only in general terms.

According to a State Department official, Duarte's illness has prompted discussions among Salvadoran officials about the possibility of Duarte's resigning.

ARENA soon will begin laying the groundwork for an effort to portray the party as a moderate force in Salvadoran politics that contrasts with the unsavory image it has among many in Congress.