      SUBROUTINE UPPER (STRING)
C                                                                               
C          CONVERTS FROM LOWER CASE TO UPPER CASE                     
C          LETTERS IN CHARACTER VARIABLE 'STRING'.                              
C                                                                               
      CHARACTER*(*)  STRING
C
C     ... Determine machine dependent character offset.  This method works
C     ... for ASCII, EBCDIC, and any character set that has a constant
C     ... offset between the lower and upper case alphabet
      IOFF = ICHAR('A') - ICHAR('a')
C
C     ... Convert letters to upper case
      DO 4010 N=1,LEN(STRING)
      IF(STRING(N:N) .GE. 'a'  .AND.  STRING(N:N) .LE. 'z')
     *  STRING(N:N) = CHAR (ICHAR (STRING(N:N)) + IOFF)
4010  CONTINUE

      RETURN                                                                    
      END                                                                       
