Preparation of carboxylic acids or their salts, halides or anhydrides by reactions not involving formation of carboxyl groups