next up previous contents index
Next: Alias manipulation Up: Description of user Previous: Description of user

Initialisation and termination

HEPDB, Zebra and HBOOK initialisation

CALL CDPAW (NWPAW,NHBOOK,IDIV*,CHNAME,NW,NWMAX,CHOPT,IRC*)

NWPAW
The number of words of dynamic store in common /PAWC/
NHBOOK
Variable containing the number of words for use by HBOOK
IDIV
Variable containing the index of user division created in common /PAWC/
CHNAME
Name of user division
NW
Initial number of words for user division
NWMAX
Maximum number of words for user division
CHOPT
Character option
' '
Initialise HEPDB divisions in common /PAWC/, including user division CHNAME.
'Z'
Also initialise Zebra via a call to MZEBRA
'P'
Issue call to MZPAW
'H'
Also initialise HBOOK with NHBOOK words
IRC
Integer return code
0
Normal completion  

This routine initialises Zebra, HBOOK and HEPDB. Note that HEPDB is automatically initialised on the first call to CDOPEN.

Obtain file name from database prefix

CALL CDPREF (LUN,CHPREF,CHTOP*,CHFILE*,IRC*)

LUN
Fortran logical unit for accessing the names file.
CHPREF
Two character database prefix
CHTOP
Top directory name constructed from database prefix
CHFILE
Full file name of the database  
IRC
Integer return code
0
Normal completion

This routine returns the top directory name and full file name of a HEPDB database, identified by a unique two character prefix. In the case of VM/CMS systems, the appropriate mini-disks are linked and accessed automatically. The environmental variable CDSERV must be set before calling this routine, as shown below.

Access an existing database file

CALL CDOPEN (*LUNDB*,LUNFZ,CHTOP,CHFILE,*LRECL*,IDIV,CHOPT,IRC*)

LUNDB
Fortran logical unit or C file pointer for accessing the database file.
LUNFZ
Fortran logical unit to be used for sending updates to the database server.
CHTOP
Name of the Top Directory
CHFILE
Character variable giving the file name
LRECL
Integer variable specifying the record length of the database file in words. If a value of zero is given on input, the record length will be automatically determined from the file itself. The actual value used is returned in this variable if the file is successfully opened.
IDIV
User Division
CHOPT
Character Option
'E'
Expand system division of the store in which IDIV resides
'Q'
Do not print messages such as version number
'N'
The database file is in native format (exchange mode is the default)
'T'
Suppress check on insertion time. gif

'C'
Use C I/O instead of Fortran I/O
'P'
Preserve case of file name (Unix systems)
'R'
Access the database in read only mode - updates not permitted.
IRC
Integer return code  
0
Normal completion
-1
Invalid top directory name
-2
The file is already open with correct LUNDB and CHTOP
-3
The file is already open with wrong LUNDB or CHTOP
-4
Already a file is opened with the same unique identifier as requested for this CHTOP
-5
Invalid process name in Online context
-6
Error in IC_BOOK for booking the CACHE
-7
Error in CC_SETUP for reserving the CLUSCOM
-8
Cannot open journal file in server context
-9
Unable to open FZ communication channel
-10
Host unable to open RZ file

On VAX/VMS systems, C I/O is automatically triggered for files of record type STREAM_LF.

Create and access a new database file

CALL CDNEW (*LUNDB*,CHTOP,CHFILE,IDIV,NPAIR,NQUO,NPRE,NTOP,LRECL,CHOPT,IRC*)

LUNDB
Fortran logical unit or C file pointer
CHTOP
Name of the Top Directory
CHFILE
Character variable giving the file name
IDIV
User Division
NPAIR
Number of key pairs to be used in object selection.
NQUO
Quota for the database file (see RZMAKE).
NPRE
Number of records that should be preformatted (essential for VM systems or when afs access is desired)
NTOP
Unique identifier for the database file (optional)
CHOPT
Character Option as for RZOPEN/RZMAKE except exchange mode is the default.
'A'
In the case of more than one key pair, all pairs will be checked in turn.
' '
(Default) Assume a hierarchy in the validity keys. That is, the second and subsequent key pairs are only checked if the match on the first pair was successful (e.g. in the case of PERIOD/RUN/EVENT, the run validity is only checked if the period matches etc.)
IRC
Integer return code  

Send or cancel pending database updates

CALL CDSAVE (CHTOP,CHOPT,IRC*)

CHTOP
Name of the Top Directory (without the leading //). See below.
CHOPT
Character variable specifying the options required.
' '
default - any pending updates are sent and the journal file reopened.
'P'
Pending updates are purged.
'S'
On Unix systems, a signal is sent to the server indicating that new updates have arrived. This will cause the server to wakeup immediately, rather than at the default interval.
'W'
Wait for response from server (not yet implemented).
 

It is not normally necessary to call CDSAVE to send updates to the server. Each time an update is made, a check is performed to see if it is for the same database as previous updates. If not, pending updates are sent. When CDEND is called, any remaining updates are sent.

To send pending updates and switch to a new database, specify in CHTOP the top directory name of the new database (e.g. CDXX for a database with prefix XX).

To send pending updates without switching to a new database, specify a blank character.

CDSAVE will only send updates if the top directory name differs from

Terminate access to one or all database files

CALL CDEND (CHDIR,CHOPT,IRC*)

CHDIR
Character variable specifying the name of the top directory of the file to be closed.
CHOPT
Character variable specifying the options required.
' '
default, close file specified by the variable CHDIR
'A'
close all files - CHDIR not used
'C'
journal file is closed and sent to the server. (By default, the journal file is reopened.)
'P'
journal file is purged - updates will not be performed.
'S'
For CDSERV only - suppresses call to CDSAVE
'W'
call MZWIPE for the division(s) associated with the files that are closed.
IRC
Integer return code  
0
Normal completion

This routine closes the specified database file by calling the RZ routine RZCLOS. Any existing journal file is closed and sent to the database server. If option A is not specified, the journal file will be reopened after being sent to the server.



next up previous contents index
Next: Alias manipulation Up: Description of user Previous: Description of user


Janne Saarela
Tue May 16 10:31:09 METDST 1995