The sulfur K and L 2,3 x-ray absorption near-edge structure (XANES) spectra of FeS, CoS and NiS having the NiAs-type crystal structure have been measured. Theoretical analysis of the experimental data has been conducted by the full multiple-scattering approach. Good agreement between experimental and theoretical data is obtained for comparatively small clusters containing 19-37 atoms. There is no significant difference between S K-edge absorption spectra for the studied compounds calculated by G4XANES and FEFF8.2 packages. The electronic structure of NiS and CoS has been studied by analysing the distribution of calculated electronic states of the sulfides.