Scenario 1. A Search Function
- Starting the transaction
- Waiting for the host system to respond
- Analyzing the response to see if it is the expected response
- Extracting and using the data from the response
Your programmed operator can use a series of EHLLAPI functions to mimic these actions. After determining the correct starting point for the host system transaction, the programmed operator can call the Search Presentation Space (6) function to determine which keyword messages or prompting messages are on the display screen.
- Use the Wait (4) function that waits for the X CLOCK, X [], or X SYSTEM condition
to end (or returns a keyboard-locked condition if the terminal has
locked up).
If the keyboard is inhibited, your EHLLAPI program can call the Copy OIA (13) function to get more information about the error condition.
- Use the Search Presentation Space (6) function to look for an expected keyword to validate that the proper response had been received.
- Use the Copy Presentation Space to String (8) function (or any of several data access functions) to extract the desired data.
The Search Presentation Space (6) function is critical to simulate another task of the terminal operator. Some host systems do not stay locked in X CLOCK, X [], or X SYSTEM mode until they respond; instead, they quickly unlock the keyboard and allow the operator to stack other requests. In this environment, the terminal operator depends on some other visual prompt to know that the data has returned (perhaps a screen title or label). The Search Presentation Space (6) function allows your EHLLAPI program to search the presentation space while waiting. Also, while waiting for a response, calling the Pause (18) function allows other DOS sessions to share the central processing unit resource. The Pause (18) function has an option that allows your EHLLAPI program to wait for a host system update event to occur.
No Response From Host. Retry?
In this environment, program revisions become very important considerations, because the programmed operator must be reprogrammed for even minor changes in the display messages.
Enter Part Number:
as
a prompt, he or she will probably be able to respond properly to an
application change that produces the message:
Enter Component Number:
However, because the programmed operator is looking for a literal keyword string, subtle changes in message syntax, even as trivial as uppercase versus lowercase, can make the program take a preprogrammed error action.