        subroutine WHTCMD(CMD)
      include 'INPAR.INC'
      include 'UNITS.INC'
      integer NPRIC,CMD,CMDLEN(26),INUNIT,MINCMD(26)
      integer NCMDS,NDELIM,EOF,IMBED,MATCH
      character DELIM(6)*1,PRICMD(138)*1
      character CRSFMT*15
      data CRSFMT/'('' EXAMS-> ''  )'/
      data NCMDS, NPRIC /26, 138/
      data CMDLEN/
     &  8, 4, 4, 3, 4, 4, 5, 4, 6, 4, 11, 8, 5, 6,
     &  5, 5, 4, 8, 3, 2, 7, 4, 7, 4, 5,  8/
        data MINCMD/
     &  3,  2,  1,  2,  2,  1,  3,  2,  3,  2,  2,  2,  2,  3,
     &  2,  1,  1,  2,  2,  2,  3,  2,  2,  3,  1,  2/
        data PRICMD/'C','H','E','M','I','C','A','L', 'S','H','O','W'
     &,'Q','U','I','T', 'R','U','N', 'E','X','I','T', 'H','E','L','P'
     &,'P','R','I','N','T', 'L','I','S','T', 'C','H','A','N','G','E'
     &,'P','L','O','T', 'E','N','V','I','R','O','N','M','E','N','T'
     &,'D','E','S','C','R','I','B','E', 'S','T','O','R','E'
     &,'R','E','C','A','L','L', 'E','R','A','S','E', 'A','U','D','I','T'
     &,'Z','E','R','O', 'C','O','N','T','I','N','U','E', 'S','E','T'
     &,'D','O', 'P','R','O','D','U','C','T', 'L','O','A','D'
     &,'C','A','T','A','L','O','G', 'R','E','A','D'
     &,'W','R','I','T','E', 'P','A','S','S','W','O','R','D'/
        data DELIM,NDELIM/' ','=','@','?','*','!',6/
      CRSFMT(13:14) = CRSTOP(MACHNO)
100   continue
      if (DOFLAG.eq.0) write (TTYOUT(MACHNO),CRSFMT)
      INUNIT = TTYIN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1.or.INPERR.eq.1) then
         if (EOF.eq.1) then
            write (TTYOUT(MACHNO),5000)
5000        format (/' End of command file.'/)
         elseif (INPERR.eq.1) then
            write (TTYOUT(MACHNO),5010)
5010        format (/' Error reading command; no action taken.'/)
         endif
         INPUT = ' '
         go to 100
      endif
      START = IMBED(INPUT,0)
      if (START.eq.-999) go to 100
      call SKAN (INPUT,START,STOPIT,TYPE,DELIM,NDELIM)
      if (TYPE.ne.100) go to 120
110   continue
      write (TTYOUT(MACHNO),5020)
5020  format (' Command not recognized. Type HELP for command',' informa
     &tion.')
      go to 100
120   continue
      if (TYPE.eq.3) then
         CMD = 20
         go to 130
      endif
      if (TYPE.eq.4) then
         CMD = 2
         go to 130
      endif
      if (TYPE.eq.5.or.TYPE.eq.6) go to 100
      CMD = MATCH(NCMDS,NPRIC,CMDLEN,PRICMD,MINCMD)
      if (CMD.eq.0) go to 110
130   continue
      return
      end
