### CAT_TOPEN

Open a catalogue and obtain an identifier to it

#### Description:

Open a catalogue and obtain an identifier to it.

The matrix of possibilities for STATE and MODE is:

STATE = ’NEW’, then MODE = ’WRITE’ is ok and MODE = ’READ’ if forbidden.

STATE = ’OLD’ then MODE = ’WRITE’ is ok and MODE = ’READ’ is ok.

Notes:

$\ast$ If a catalogue already exists and an attempt is made to open it with STATE = ’NEW’, CAT_TOPEN will fail with an error.

$\ast$ If an existing catalogue is opened with STATE = ’OLD’ and MODE = ’WRITE’ it will be overwritten.

#### Invocation

CALL CAT_TOPEN (CNAME, STATE, MODE; CI; STATUS)

#### Arguments

Catalogue name.
##### STATE = CHARACTER$\ast$($\ast$) (Given)
Required state of the catalogue. One of: NEW - A new catalogue is to be created, OLD - An existing (that is, old) catalogue is to be opened.
##### MODE = CHARACTER$\ast$($\ast$) (Given)
Mode in which the catalogue will be accessed. One of: READ - the catalogue may only be read from, WRITE - an new catalogue is to be written.
##### CI = INTEGER (Returned)
Catalogue identifier.
##### STATUS = INTEGER (Given and Returned)
The global status.