Using Natural (Mainframe) Is it possible to take control of the screen in an specific period of time.
I want to show a map. If the user don’t touch the keyboard in 5 minutes I want to make anothe action (For example show another screen) without hit any key…
Is there (maybe a terminal variable) that allow me to do that?
I have not tried this. However, it seems to me that by putting an INPUT statement in a “dummy” REPEAT loop with a SET CONTROL ‘N’ it might be possible to accomplish this. *TIMD could be used to control the duration of the loop, or perhaps CMROLL.
The problem with this approach is that the user doesn’t have control over the terminal, no “interaction” is possible while the session is rolled out, and even after the timer pops, there is no pending terminal read.
As i said; i haven’t tried this (and will be out of town for the next two days). however, my gut feel is that if we had some sort of input reinput pair within a dummy repeat loop, and if we used %n to skip by the input statement, we could, inbetween the input and reinput, do some testing against a time limit.
of course, there is the problem of actually giving the user access to the screen in such a setup. probably requires a bit more thought.
Wolfgang is right, the mainframe session is usually rolled out, and therefore not “active” to check timers or such.
One easy workaround might be to put some timer logic into the PC’s terminal emulation. For example, if you had Entire Connection you could use the API or perhaps a procecure that would press the enter key for them after 5 minutes, which would wake up the mainframe side, and then the mainframe program could check a timer and present a screen. Somewhat awkard, but possible.
Another alternative is to use an asynch task on the mainframe side that is attached to the main task. The async is active behind the scene, watching/waiting on a timer, while the main task is rolled out. When the time is up, it taks action… perhaps writing a screen to the same terminal. Much of how this is implemented depends on your TP monitor. Are you using CICS?