  The carriers of the 21 and 30\,$\mu$m emission features in infrared spectra
of circumstellar envelopes are a long-standing enigma. In this paper, we
present the results of molecular line observations toward two circumstellar
envelopes exhibiting the 21 and/or 30\,$\mu$m features, IRAS\,21318+5631 and
22272+5435, aiming at investigating whether they have unusual gas-phase
chemistry and searching for possible gas-phase precursor of the carriers of the
two dust features. The spectra cover several discrete frequency ranges of
130--164\,GHz and 216.5--273\,GHz, resulting in a detection of 13 molecular
species and isotopologues in each object. Rotation-diagram analysis is carried
out to determine the molecular abundances, column densities, and excitation
temperatures. We did not discover any molecular species that is unexpected in a
normal C-rich star. Nevertheless, there exists subtle difference between their
molecular abundances. IRAS\,22272+5435 shows stronger SiC$_2$ and HC$_3$N lines
and weaker SiS lines than IRAS\,21318+5631, presumably suggesting that this
21\,$\mu$m source is more carbon rich and has experienced a more efficient dust
formation. We discuss the potential implications of the results for the
carriers of the 21\,$\mu$m and 30\,$\mu$m features.
