Extraction and Merging of database records

Copying database records from one to another database

Copying database records from one to another database

There will probably be a need to extract only a subset of the contents of a database to form a smaller private database. For maintaining the main database, the manager will have to be able to merge new or updated records from privately created database files into the main database, and there will also be the need to create `snapshot' records of the status of the current valid records in the database. Routine HDBEXTR serves these purposes.

HDBEXTR extracts records from the subdirectory (or subdirectories) specified by the path PATHI only leads to a directory, not a subdirectory) the NSDIR-element CHARACTER vector CHDIR, which contains the subdirectory names (optionally, records from all subdirectories are extracted). The extracted records are valid for the period of validity specified in the integer vector W option is not requested and there is more than one valid current record, appropriate for the given type, in the range then a series of summary records (each of which compresses the information from the chain of records which apply to a part of the period of validity) is created. The extracted record is written into the corresponding subdirectory in the file with top-directory name PATHO. There is also additional information written which is needed for book-keeping when databases are merged (see also option HDBSTOM). If the user only wants a copy of the database records he can choose option M, which suppresses the storing of merge informations. By default a brief summary of all extracted records is printed, unless option N is specified. If the user wishes to write the extracted records also on an FZ file he should specify the option X, but note that the appropriated FZ calls should have previously been issued before calling HDBEXTR.

        +--------------------------------------------------------+
        |CALL  HDBEXTR (PATHI,PATHO,KEYS,CHSDIR,NSECD,CHOPT,IRC*) |
        +--------------------------------------------------------+
                                  

PATHI
Full pathname of directory to be extracted.
PATHO
Name of top directory of the output database. This database should not yet contain any of the subdirectories that are to be copied from the main database, unless option O is requested.
ISEL
Vector specifying the required validity range.
CHDIR
Character array of subdirectories to be extracted
NSDIR
Number elements in array CHDIR
CHOPT
Character variable containing a string of single letter options
' '
directory specified by PATHI will be extracted
'A'
All subdirectories of the specified path will be extracted
'C'
extract only records with key status bit copy set
'I'
extend the validity range beyond one experiment number
'M'
no merge information will be stored
'N'
no summary will be printed
'S'
a selected subset of subdetector subdirectories (specified in CHDIR) will be extracted
'O'
subdetector-subdirectories in PATHO may exist
'W'
the whole number of stored records are copied to the auxiliary database. However the key word containing the pointer to the logging will be changed. The input values of ISEL are ignored.
'X'
write extracted records also to an FZ file, where the FZ logical unit number is given by the logical unit number for PATHO+10
IRC
Return status
0
Normal completion

Merging databases or database records

Transferring datastructures to and from FZ files

Converting database records into an FZ file

Reading database records from FZ files

Merging FZ files written by HDBEXTR or HDBMERG