      subroutine PKCREC(RECNUM, INPUT, LENGTH)
      include 'SIZE.INC'
      include 'UNITS.INC'
      integer RECNUM,LENGTH,I,L
      character BUFFER(VARCEC)*1, INPUT(LENGTH)*1, TEMP*4
      write (TEMP,5000) LENGTH
5000  format (I4)
      do 100 I = 1, 4
         BUFFER(I) = TEMP(I:I)
100   continue
      L = 4
      do 110 I = 1, LENGTH
         L = L+1
         if (L.gt.VARCEC) then
         RECNUM = RECNUM+1
         write (RANUNT(MACHNO),rec=RECNUM) BUFFER
            L = 1
         endif
         BUFFER(L) = INPUT(I)
110   continue
      RECNUM = RECNUM+1
      write (RANUNT(MACHNO),rec=RECNUM) BUFFER
      return
      end
