The dbase instruction sends a message to a data interface process (DIP).
Synopsis
dbase(type.dip,mcont_field,ctype.dst,mbyte,type.src,nbyte)
Description
The dbase instruction sends a message to a DIP and usually receives data in return. It uses any DIP to interface with the host or local database. All the arguments must be specified for the dbase instruction to execute. The arguments are defined by the script writer.
A message is sent to a DIP specified by the first argument in the dbase instruction. The type.dip argument can be a DIP number (for hardcoded DIPs) or name (for Dynamic DIPs). The mcont_field is a DIP-specific code signifying the DIP action. The information returned by the DIP is stored at the destination address specified by ctype.dst. Its length is specified by mbyte. If mbyte is negative, the dbase call does not wait for a response from the DIP. The information passed to the DIP from the TSM is read beginning from the address specified by type.src. Its length is specified by nbyte. It is important that the DIP and TSM script agree on the structure and contents of the information passed. If the dbase call is successful and the DIP returns a message to the script, r.0 is set to the mcont value of the DIP message.
If type.src is a register, nbyte is ignored. If nbyte is zero, no information is passed to the DIP. If nbyte is negative, no message is sent to the DIP, but the dbase call may wait (if mbyte is not negative) for a message from the DIP. If the DIP is not running, r.0 is set to -1. If the DIP does not respond within a reasonable time (the default value is 45 seconds), r.0 is set to -2. To reset the default value for timeout, use the nwitime instruction.
Example
In the following example, this instruction uses Bankdip DIP to retrieve information. The DIP action is defined by the second argument (LOGON). The retrieved information is stored in user memory beginning at CUSTRECS and has a length of SZCUSTREC bytes. CUSTRECS is found in the application-name.def.h header file. The argument LOGONS is also defined in the application-name.def.h header file and marks the starting address of the information passed to the DIP for retrieving the information. The LOGONS field is 5 bytes long.
dbase("Bankdip",LOGON,ch.CUSTRECS,SZCUSTREC,ch.LOGONS,5)
See also