      SUBROUTINE CHANGELOCKSTATUS(lockstat,il,lockup)

C     CHANGELOCKSTATUS RESETS LOCK STATUS TO NEW
C     INPUT VALUE

      character*(*) lockstat
      character*11 locktype(0:4)

      data locktype/'open       ','*READ-ONLY*',
     * '*EXCL-LOCK*','OV_READONLY','OV_EXCLLOCK'/

      call clearstring(lockstat,il)
      call findlastchar(nsp,locktype(lockup),11)
      lockstat(1:nsp)=locktype(lockup)(1:nsp)

      return
      end
