EXISTS

Use the EXISTS statement to check for the existence of a specified field on the current 3270 screen. The statement returns TRUE or FALSE.

Syntax


This picture shows the syntax of the EXISTS statement.

Example

IF EXISTS ( Main_menu.Extension_field )
THEN
.
.
.
ENDIF

Procedure

To use the 3270 Script window’s Statements menu to define an EXISTS statement, follow this procedure:

  1. From the Welcome window, click on Applications —> 3270 Servers
  2. Selecting the EXISTS statement : Click Statements —> Conditional.

    The system displays the Conditional Definition window.

  3. Selecting the conditional statement : Click the appropriate conditional statement that is to use EXISTS as a condition:
    • IF condition THEN
    • ELSEIF condition THEN
    • WHILE condition DO
  4. If the statement is to test when the EXISTS condition is not true, click the NOT pushbutton.
  5. Defining the condition : Click condition.

    The system displays the Condition Definition window.

  6. Click the pushbutton next to Condition Type, then click Field Exists.

    The Condition Definition window changes to suit the EXISTS statement definition.

  7. Specifying the field : Type the name of the field next to Field, or click Field to display the Field Selection window to select the field.

    In the Field Selection window:

    • Click the button next to System Server if the field exists on a screen that is defined to the 3270 server named system. Scripts and screens defined to the system server can be accessed by all 3270 servers.
    • Click the required screen and field.
    • Click the Detail pushbutton to show the description of the selected field.
  8. Click OK.

    The Conditional Definition window displays the EXISTS statement in the condition field.

  9. Adding the statement to the script : Click OK.

    The EXISTS statement is added to the script.