        subroutine DOIT
      include 'INPAR.INC'
      include 'UNITS.INC'
      integer IMBED,MATCH,IT,I,JSTOP,IL,J,TWO,RSPSIZ
      integer EOF, INUNIT, MINRES(2), NUMCHR, NORESP(2), WHICH
      character DELIM*1, RESP(8)*1, REQFMT*25
      data REQFMT/'(1X,''Help, or Quit-> ''  )'/
      data DELIM, NORESP, MINRES /' ', 4,4, 1,1/
      data RESP / 'H','E','L','P', 'Q','U','I','T'/
      data TWO,RSPSIZ /2, 8/
      INUNIT = TTYIN(MACHNO)
      if (MACHIN.eq.'IBM') then
         NUMCHR = 7
      else
         NUMCHR = 41
      endif
100   continue
      START = IMBED(INPUT,STOPIT)
      if (START.ne.-999) go to 120
110   continue
      write (TTYOUT(MACHNO),5000) NUMCHR
5000  format (/' Enter name of file (no more than ',I2,' characters),')
      REQFMT(23:24) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 220
      STOPIT = 0
      go to 100
120   continue
      call SKAN (INPUT,START,STOPIT,TYPE,DELIM,1)
      if (TYPE.eq.100) STOPIT = 81
      WHICH = MATCH(TWO,RSPSIZ,NORESP,RESP,MINRES)
      if (WHICH.eq.0) go to 130
      if (WHICH.eq.2) go to 220
      write (TTYOUT(MACHNO),5010)
      if (MACHIN.eq.'IBM') then
         write (TTYOUT(MACHNO),5020)
      else
         write (TTYOUT(MACHNO),5030)
      endif
      go to 110
5010  format (//' The "DO" or "@" command  provides  a means of executin
     &g'/' stored EXAMS commands. In reponse to the prompt,  enter'/' th
     &e name of the file that contains the stored commands.')
5020  format (' Under the IBM Fortran subset, only those names pre-alloC
     &ated'/' in JCL can be allowed for command files.  The defaults set
     & by'/' Athens ERL are "DOFILEn" where n is a single-digit integer,
     &'/' or a file named "AUDOUT".')
5030  format (' A filename extension of .EXA is added to the name if no 
     &period'/' is present in the name as entered. The maximum length fo
     &r file'/' names is 41 characters; this limit includes the .EXA suf
     &fix.'//)
130   continue
      if (MACHIN.eq.'IBM') then
         IT = 0
         do 140 I = START, START+5
            IT = IT+1
            FILNAM(1)(IT:IT) = INPUT(I:I)
140      continue
         I = START+6
         if (FILNAM(1)(6:6).eq.'E') FILNAM(1)(7:7) = INPUT(I:I)
         FILNAM(1)(8:) = ' '
         go to 200
      endif
      IT = 0
      JSTOP = STOPIT-1
      IL = 0
      do 150 I = START, JSTOP
         J = I
         if (INPUT(I:I).eq.'[') IL = IL+1
         if (INPUT(I:I).eq.']') IL = IL-1
         if (INPUT(I:I).eq.'.'.and.IL.eq.0) go to 170
         IT = IT+1
         FILNAM(1)(IT:IT) = INPUT(I:I)
150   continue
160   continue
      FILNAM(1)(IT+1:IT+4) = '.EXA'
      IT = IT+4
      go to 190
170   continue
      if (J.eq.JSTOP) go to 160
      do 180 I = J, STOPIT
         IT = IT+1
         FILNAM(1)(IT:IT) = INPUT(I:I)
180   continue
190   continue
      if (IT.lt.41) FILNAM(1)(IT+1:) = ' '
200   continue
      open (unit=DOLUN(MACHNO),FILE=FILNAM(1),status='OLD',err=210,
     &   access='SEQUENTIAL',form='FORMATTED')
      close (unit=DOLUN(MACHNO))
      IT = TTYIN(MACHNO)
      TTYIN(MACHNO) = DOLUN(MACHNO)
      DOLUN(MACHNO) = IT
      DOFLAG = 1
      go to 230
210   continue
      write (TTYOUT(MACHNO),5040)
5040  format (//' Error opening DO file. Command terminated.')
      go to 230
220   continue
230   continue
      return
      end
