β-Alkoxycarbonyl-β-enaminoketoesters 1a, b react with hydrazines to give pyrazole ortho- dicarboxylic acid derivatives 3, 4 and 5. Similarly 1a reacts with hydroxylamine to give isoxazole 6 and with amidines and guanidine to give pyrimidine ortho-dicarboxylic acid monoesters 7a-c. The total or partial hydrolysis of selected heterocycles afforded the dicarboxylic acids 8, 9 and 10 and the dicarboxylic acid monoesters 11 and 12.