      PROGRAM NETLOCKINIT
************************************************************************
*  This program will initialize the local NETLOCK database for this    *
*  node.  It creates a FORTRAN relative file format file, where the    *
*  first record contains the number of records in the file and the     *
*  last one in use, and the others contain just the data.  The data    *
*  records are 80 columns wide, and are defined by the programs that   *
*  use them.                                                           *
*                                                                      *
*  This program was written on January 18th, 1991 by Roger G.          *
*  Ruckert.                                                            *
************************************************************************
      PARAMETER (IUNIT=10)
      CHARACTER REC*80
      DATA REC(1:10)/'  100    1'/, REC(11:80) /' '/
      OPEN (UNIT=IUNIT, ACCESS='DIRECT', RECL=80, ERR=900, IOSTAT=IOS,
     2  FILE='MED$NETLOCK:NETLOCKDB.DAT', STATUS='NEW', 
     3  MAXREC=100, FORM='FORMATTED', ORGANIZATION='RELATIVE')
      WRITE (UNIT=IUNIT, REC=1, FMT=100, IOSTAT=IOS, ERR=903) REC(1:80)
  100 FORMAT (A80)
      CLOSE (IUNIT, IOSTAT=IOS, ERR=906)
      PRINT *, '%I, Successfully created file ',
     2  'MED$NETLOCK:NETLOCKDB.DAT'
      CALL EXIT (1)
************************************************************************
*                                                                      *
***   E R R O R S                                         BLOCK 900  ***
*                                                                      *
************************************************************************
  900 PRINT *, 'Cannot open MED$NETLOCK:NETLOCKDB.DAT; STATUS = ', IOS
      CALL EXIT (4)
*
  903 PRINT *, 'Cannot write NETLOCKDB.DAT; STATUS = ', IOS
      CALL EXIT (4)
*
  906 PRINT *, 'Cannot close NETLOCKDB.DAT; STATUS = ', IOS
      CALL EXIT (4)
*
      END
