Heat broiler on high.
Butter one side of each piece of egg bread. Top 6 slices of the bread with ham on the unbuttered side. Top each with dill pickle slices (if using). Spread mustard on unbuttered side of the remaining 6 slices and top to make 6 sandwiches (buttered sides out).
Arrange sandwiches on a baking tray. Place under the broiler until golden, about 3 minutes. Flip sandwiches and divide grated cheese over each sandwich. Broil until the cheese is golden and bubbly, about 2 minutes.
Serve immediately with a green salad.