Key and Argument Registers [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation
HP Transact Reference Manual
Key and Argument Registers
The Transact processor uses the key and argument registers to perform
keyed access to KSAM files or data sets. You must use these registers to
perform keyed access to such files. However, you do not need to use
these registers to access MPE files or for serial access to data sets or
KSAM files.
Both registers are write-only registers. That is, you can assign a data
item name to the key register and a value to the argument register, but
you cannot read either register, nor can you test their contents. The
processor uses the contents of these registers for file and data set
access, and a program can pass their values to an external procedure.
A unique pair of key and argument registers is made available with each
level of nesting of the PERFORM= option of the data management verbs. As
many as ten levels can be declared.
Key Register
The key register contains a single data item name that identifies a key
item in a KSAM file or a search item in a data set. The item name you
place in the key register is used by the processor to perform a keyed
access to an existing record. The key register is not used to add a new
record or entry.
The key register is needed only when the key name must be specified. It
is needed to locate a particular key in a KSAM file and to locate the
chain head in a detail data set. The key register is not needed to
access key items in manual or automatic master sets. There is only one
key (search) item in a master data set. Accordingly, that data item is
"known" and need not be specified.
Argument Register
The argument register contains the value of the key item that is named in
the key register. The Transact processor uses this value to locate any
records in a KSAM file or a data set with that key value. If you try to
perform a keyed access without setting up the key and argument registers,
Transact issues an error message.
The argument register is needed when an actual key value is used to
access a file or data set. If the key is known (as it is in a master
set), you need not set up the key register, but you must still set up the
argument register, unless you want to access all the entries.
For example, suppose you have a detail data set from which you want to
retrieve all product numbers with the value A105. You can put the search
item name (PROD-NO) in the key register and the value (A105) in the
argument register.
You can then use an appropriate Transact statement to retrieve any
entries that contain a product number with the value A105. Transact
performs all the necessary database calls.
MPE/iX 5.0 Documentation