Previous Topic: Batch Control Event Status ConditionsNext Topic: Process Commands


Environment Status Conditions

Environment status conditions are used to determine the environment in which the application is being executed. The status conditions can be tested in both online and batch environments.

Syntax for the environment status conditions is shown below:

►►──┬─ $BATCH ──┬─────────────────────────────────────────────────────────────►◄
    └─ $ONLINE ─┘
$BATCH

Is true when the application is executing in the batch environment.

$ONLINE

Is true when the application is executing in the online environment.

Example

In the following example, different types of processing are performed, depending on the runtime environment:

IF $ONLINE
  THEN
    DISPLAY.
  ELSE
    WRITE TRANSACTION.