For example, the macrocyclic polyimides wherein Z2 is sulfur may be converted to linear polyimides by reaction with at least one basic sulfide of the formula M--S--X2, wherein M is an alkali metal (usually sodium) and X2 is M or an aryl radical, preferably phenyl.