
*****************************************************************
*
* Subroutine to check for unexpected SortMerge errors.  Used by 
* the example FORTRAN86 SortMerge program.

	Subroutine ChkSts(iErc, irgSts)
	dimension irgSts(2)
		if (iErc .ne. irgSts(1)) call ChkErc(8)
		if (iErc .eq. 0) return
		write(*, '(  1x, a)')  'Sort Error'
		write(*, '(1x, a, i5)') '    Status code', iErc
		if (irgSts(2) .ne. 0) write(*, '(1x, a, i5)')
     .			'    Detail status code', irgSts(2)
		iErc = ISMTST(irgSts)
		stop
	end