*ON Define Events for Latent Conditions

*ON %TIME=s RETURN

This condition invokes a timer for a specified time, after which CFS will pass control from a Connection back to the main task (command field). This makes it possible to return to CFS from an "active" Connection, even though nothing was entered from the Connection. Thus, CFS can regain control from programs with asynchronous output, such as $CONSOLE.

s Elapsed time in seconds (0 <= s <= 9999).

Examples:

The following procedure establishes a Connection to $CONSOLE, then issues a /STA MSG command, and then a /STA P command. On returning to the main task with K2 + R, the Connection will shut down automatically.

OC9$CONSOLE,,,R R: Return switch. CFS switches back to the main task after
successfully opening the Connection.
xxxxx,C'sssss' Enter the userid and password after returning from the
CC9B Connection: K2 for the Console
*ON %TIME=1 RETURN Define condition: return from the Connection to the main
task of CFS after 1 second.
STA MSG Console input
CC9B After returning to the main task (*ON %TIME=1):
regenerate K2 for the console
*ON %TIME=1 RETURN Reinitialise return timer.
STA P Console input
*ON %CMD CONTINUE Define condition: after returning to the main task, the
procedure should be continued automatically.
*DIA Switch the input source to user dialog
DC9 After returning to the main task by means of the user
pressing K2 + R, procedure mode will be resumed, and the
Connection will be terminated by DC9.

A Connection is tp be established to the host system VAR2, under the TSOS userid. Statistics for system performance analysis are to be collected using the SM2 program. A DO procedure to achieve this could look as follows:

/PROC N
/SYSFILE SYSDTA=(SYSCMD)
/SETSW ON=(1,4)
/EXEC $CFS
*002 FILE=NO
OC1,,VAR2/LOGON TSOS,...
EXEC $SM2
*ON %TIME=10 RETURN After 10 seconds the procedure will switch back to the main
CFS task.
HC SM2.STATISTICS,N All following output will be captured to the hardcopy specified
file.
START Start the SM2 statistic output. The statistical information
will be displayed in 120 second intervals.
Since only the first display is of interest, an exit will be
made from the Connection after 10 seconds. This allows new CFS
commands to be entered.
CC1B Switch to Connection 1 by simulating the K2 key. This will
suppress further SM2 statistic output.
NHC Switch off hardcopy mode.
LOGOFF Close the Connection.
END Terminate CFS.
/SETSW OFF=(1,4)
/ENDP