On a modern grand piano and virtually all digital pianos with three pedals, the middle pedal is a sostenuto pedal. It sustains only those notes which are already depressed at the time that the pedal is depressed, allowing future notes played to be unaffected. To demonstrate, play a C chord in the octave below middle C and immediately step on the sotenuto pedal. Then proceed to play a glissando in the area above middle C. The chord will sustain while the glissando does not.
Do you need an additional help?