      subroutine STAOPT(IVAL)
      include 'UNITS.INC'
      include 'INPAR.INC'
      integer EOF,INUNIT,NVAL,VALLEN(6),MINVAL(6),IVAL,IFIND,IT,LENVAL
      character VALNAM(23)*1, REQFMT*17
      data REQFMT/'(/'' Option-> ''  )'/
      data NVAL,VALLEN,MINVAL,LENVAL/6, 3,3,3,6,4,4, 1,2,3,4,1,1, 23/
      data VALNAM/'A','V','E', 'M','A','X', 'M','I','N',
     & 'M','I','N','M','A','X', 'H','e','l','p', 'E','x','i','t'/
      REQFMT(15:16) = CRSTOP(MACHNO)
100   continue
      IVAL = IFIND(NVAL,LENVAL,VALLEN,VALNAM,MINVAL)
      IT = IVAL+3
      go to (120,130,110,130,130,130,130,120,130), IT
110   continue
      write (TTYOUT(MACHNO),5000)
5000  format (1X,'Choice not recognized; please try again.'/)
120   continue
      write (TTYOUT(MACHNO),5010)
5010  format (/                                                         
     - 1X,'The following statistical options are available:'//          
     -16X,'MAX    - Maximum concentration'/                             
     -16X,'MIN    - Minimum concentration'/                             
     -16X,'AVE    - Average concentration'/                             
     -16X,'Help   - This message'/                                      
     -16X,'Quit   - Return to the EXAMS prompt')
      write (TTYOUT(MACHNO),REQFMT)
      INUNIT = TTYIN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      IVAL = -1
      STOPIT = 0
      if (EOF.ne.1) go to 100
130   continue
      return
      end
