      program UTILIT
      include 'SIZE.INC'
      include 'UNITS.INC'
      integer OFFSET, IBUFF(VARIEC)
      integer I, J, K, M, L, NOMOD
      integer RECDAT(FILDAT), HRECS
      data IBUFF, RECDAT /VARIEC*0, FILDAT*0/
      if (MACHNO.eq.11) then
         open (unit=PRINTR(MACHNO),FILE='FOR007.DAT',status='new')
      else
         open (unit=PRINTR(MACHNO),FILE='FOR007.DAT',status='unknown')
      endif
      write (PRINTR(MACHNO),5000)
5000  format  (///,16X,'***************************',/,                 
     -             16X,'*         EXAMS           *',/,                 
     -             16X,'*  File Creation Utility  *',/,                 
     -             16X,'*        01-Nov-89        *',/,                 
     -             16X,'***************************')
      open (unit=RANUNT(MACHNO),file='EXAMS.DAF',status='unknown',
     &  recl=LENREC,access='direct',form='UNformatted')
      HRECS = FILDAT/VARIEC
      if (FILDAT-VARIEC*HRECS.ne.0) HRECS = HRECS+1
      RECDAT(13) = VARREC
      RECDAT(14) = VARIEC
      RECDAT(27) = NPX
      RECDAT(28) = NCON
      RECDAT(29) = NCHEM
      RECDAT(30) = NTRAN
      RECDAT(31) = MAXDAT
      RECDAT(32) = MAXMAS
      RECDAT(49) = VARCEC
      do 120 I = 1, HRECS
         J = (I-1)*VARIEC
         K = J+VARIEC
         J = J+1
         M = 0
         do 100 L = J, K
            M = M+1
            if (L.gt.FILDAT) go to 110
            IBUFF(M) = RECDAT(L)
100      continue
110      continue
         write (RANUNT(MACHNO),rec=I) IBUFF
120   continue
      OFFSET = HRECS
      call BLDHLP (OFFSET)
      call BLDMOD (OFFSET,NOMOD)
      call BLDDEF (OFFSET,NOMOD)
      call DATAIN
      call DBDUMP
      stop
      end
