You can use the SET command to set $TEST to a boolean value. A value of 1, or any non-zero numeric value, sets $TEST=1. A value of 0, or a non-numeric string value, sets $TEST=0.
$TEST can be set by any command or function that can return a logical condition.
A successful JOB, LOCK, OPEN, or READ command that did not specify a timeout does not change the existing value of $TEST.
The DO command maintains the value of $TEST when calling a procedure, but not when calling a subroutine. For details, refer to the DO command.
The ZBREAK command maintains the value of $TEST when calling execute_code. For details, refer to the ZBREAK command.