Database Creation

Having setup and configured a HEPDB server, we now procede to create a new database file. This is a fairly trivial operation and code for doing this is given below. The main routine to take note of is CDNEW, which is described in detail in the next section of this manual.

                   Creating a new database file
                                  

      PROGRAM CREATE
*     ==============
*
*     Create a new, empty database
*
      PARAMETER   (NWPAW=100000)
      COMMON/PAWC/PAW(NWPAW)
*
*     Initialise Zebra, HBOOK and HEPDB
*
      CALL CDPAW(NWPAW,NHBOOK,IDIV,'USR-DIV',5000,50000,'ZPHU',IRC)
*
*     Unit for database access
*
      LUNCD  = 1
*
*     Database parameters
*
      NPAIR  = 1
      NREC   = 20000
      NPRE   = 200
      NTOP   = 1
*
*     Accept default record length (1024 words)
*
      LRECL  = 0
      CALL CDNEW(LUNCD,'geome','GEO.dbs',IDIV,NPAIR,NREC,NPRE,NTOP,
     +           LRECL,'F',IRC)
*
*     Set the log level
*
      CALL CDLOGL(' ',3,'A',IRC)
*
*     Terminate
*
      CALL CDEND(' ','A',IRC)
      END

For the sake of our example lets assume we create three databases, one for the geometric data, one for calibration and finally one for the auxiliary data. We will name these GEO.dbs, CAL.dbs and AUX.dbs respectively.