When creating IMOD names, you should group them into logical units by using name prefixes. The prefix can be any character string (except those beginning with $) and can end with an optional separator. The resulting IMOD name must obey the REXX rules for labels.
Except for IMODs invoked as subroutines or functions, underscores in IMOD name prefixes have a special use. When an IMOD task is created and the requested IMOD does not exist or is not usable, the name is shortened from the right. The last character and then all preceding characters up to, but not including, an underscore are discarded. The shortened name is then used to search for an executable IMOD. If one is still not found, the shortening process is repeated until an executable IMOD is found or there are no characters left in the name. In this manner, you can provide default IMODs to be executed in place of the one requested.
Example
You define an operator console command, HELP. To use the HELP command, the operator enters HELP xxx operands, where xxx is the name of an IMOD of the form HELP_xxx. You also provide the following IMODs: HELP_DISPLAY, HELP_VARY, and HELP_START. If the operator enters HELP VARY OFFLINE, the HELP_VARY IMOD is executed, which then analyzes the operand OFFLINE and provides an appropriate response.
However, if the operator enters HELP OFFLINE, ISERVE will try to execute the HELP_OFFLINE IMOD, which does not exist. ISERVE then shortens the IMOD name to HELP_. If you have provided an IMOD of that name, it is executed. In this example, it might be sufficient for the HELP_ IMOD to send the message, HELP NOT AVAILABLE, back to the operator.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |