      subroutine datjack2(n,x,xjj) ! bernd berg, dec 15 2000.
c second level jackknife bins  xjj(n-1,n) from  n  data  x(n). 
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension x(n),xjj(n-1,n)
c
      xsum=zero
      do i=1,n
        xsum=xsum+x(i)
      end do
c
      nm1=n-1
      factor=one/(n-2)
      do i=1,n
      do j=1,nm1
        jj=j
        if(j.ge.i) jj=j+1
        xjj(j,i)=factor*(xsum-x(i)-x(jj))
      end do
      end do
      return
      end
