      SUBROUTINE CVRS(A,KA,M,N,B,IB,JB,NUM,IERR)
      DIMENSION A(1),B(1),IB(1),JB(1)
      IP = 1
C
C        STORE THE I-TH ROW
C
      DO 11 I=1,M
      IB(I) = IP
      IJ = I
      DO 10 J=1,N
      IF (A(IJ).EQ.0.0) GO TO 10
      IF (IP.GT.NUM) GO TO 20
      B(IP) = A(IJ)
      JB(IP) = J
      IP = IP+1
   10 IJ = IJ+KA
   11 CONTINUE
C
C        COMPLETE THE SETUP
C
      IB(M+1) = IP
      IERR = 0
      RETURN
C
C          ERROR RETURN
C
   20 IERR = I
      RETURN
      END
