Code to write rank data to element sets. #1