We extend the computational code of Takenaka and Sasatani (2000) for synthetic nearfield seismograms for horizontally layered elastic media, based on the reflection/transmission matrices and the discrete wavenumber summation method, to calculate seismic motion and its spatial derivatives at a subsurface position in the attenuative media. In this paper we describe the theory of this extension and show some numerical examples to verify the extended code.