Accepting Input from AX Commands

Because the programmer controls the way an application responds to a HI command, the operator has no direct way of discovering whether a HI command is needed or what effect it has. Another feature is available that allows the process itself to prompt the operator for certain types of input. This feature is the ACCEPT statement.

The ACCEPT statement displays a string of text to the operator and suspends execution of the process. The process appears in the W (Waiting Mix Entries) system command display, where it can attract the attention of an operator. Execution resumes when the operator uses an AX (Accept) system command to pass another string of text to the process.

In some situations, you might find it more convenient for a process to continue executing until an AX string is available from the operator. This goal can be achieved in any of the following ways:

  • If the operator is familiar with the program, and knows that the program requires an AX string, he or she can enter the AX string without waiting for the process to become suspended. The operator can enter the AX string either by appending an AX task equation to the RUN statement or by entering an AX system command while the process is running. The system saves the AX string that was input by the operator. When the process executes an ACCEPT statement, the process retrieves the AX string and immediately continues executing.

    If an operator submits more than one AX string for a process before the process performs its next ACCEPT statement, then the system must either queue the extra AX strings or discard them. You can use the QUEUEDAX option of the SYSOPS (System Option) system command to enable or disable queuing of AX strings. If QUEUEDAX is set, then the system queues up to 250 AX strings for a process. If QUEUEDAX is reset, then each AX string overwrites any pending AX string for a process.

    QUEUEDAX is set TRUE by default on ClearPath systems.

  • By using a conditional ACCEPT statement. This form of ACCEPT checks for AX text previously submitted by the operator. The conditional ACCEPT returns a Boolean value indicating whether such text was found. The process continues executing normally, regardless of whether an AX text was available.

  • By using the ACCEPTEVENT task attribute. The system causes the ACCEPTEVENT of a process whenever the operator enters an AX command for that process. A process can monitor the ACCEPTEVENT using wait statements or interrupts, similar to those used for monitoring the EXCEPTIONEVENT. Whenever the ACCEPTEVENT is caused, the process can execute an ACCEPT statement to capture the AX input.