Discrete representation of the spectral shift function and the multichannel S-matrix