Preparation of carboxylic acid amides by formation of carboxamide groups together with reactions not involving the carboxamide groups