HOST commands initiate user exits, which initiate the external applications. The syntax of the HOST command is the same as the syntax used when initializing a program from the command line. When issuing a user exit command, Datastream 7i uses data stored in parameters and data displayed on screen to initialize the application. To use this data, the HOST command must contain the relevant substitution parameters.
The following substitution parameters are available. Substitution parameters have a $ prefix. Datastream 7i parameters have a $P prefix. When referencing attributes on the screen, use the $A prefix. Use the $F prefix when referencing a path/file.
|
Parameter Reference |
Prefix |
|
Datastream 7i |
$P |
|
Attributes on the screen |
$A |
|
Path/file |
$F |
The following parameters are available:
|
Parameter |
Description |
|
PERMISSIONS |
The permissions |
|
GROUP |
The user group code, e.g., Datastream 7i |
|
R5USER |
The code of the current user, e.g., USR102 |
|
LANGUAGE |
The language code of the user, e.g., EN |
|
THIS_FUNCTION |
The code of the Datastream 7i function, e.g., OMOBJC |
|
R5SESSION |
The Datastream 7i session ID, e.g., 5508921 |
|
FUN_RENTITY |
The EN entity code of the screen, e.g., OBJ |
When the external application requires a user code, the HOST command is (where $F indicates the executable to start)
MyProg $P.R5USER or $F $P.R5USER
The HOST command requires the R5SESSION parameter if the external application returns commands back to Datastream 7i. When the focus is back in Datastream 7i, it uses its session ID for retrieving any messages that the external application issues. For this example, the HOST command is
MyProg $P.R5SESSION $P.R5USER.
Send field contents to the external application. For example, when starting an external application from the Equipment form (OMOBJC) and sending the equipment code, the HOST command is MyProg $A.B1.OBJ_CODE. If field B1.OBJ_CODE is empty, or if the field is not available on the screen, a blank would replace the substitution string $A.B1.OBJ_CODE. Datastream 7i would not issue an error message.
This field function enables you to define User Exits that can call external applications. For example, if you want to check a part code on the Part form (SMPART) and also check that code when it is used on the Equipment form (OMOBJC), the HOST command is
MyProg $A.B1.PAR_CODE $A.B1.OBJ_PART.
On the Parts form (SMPART), $A.B1.OBJ_PART would be empty, and on the Equipment form (OMOBJC), $A.B1.PAR_CODE would be empty.
Datastream 7i issues an Oracle error when you misspell a parameter or reference a nonexistent parameter.