QUERY_SCREEN

Use the QUERY_SCREEN statement to return the name of the current 3270 screen. The statement compares the current 3270 screen against all the saved captured screens and returns the name of the first screen that matches. If no match is found, the statement returns an empty string.

The QUERY_SCREEN statement is typically followed by a CASE statement that performs operations specific to each potential screen.

Syntax


This picture shows the syntax of the QUERY_SCREEN statement.

Example

screen_name  =  QUERY_SCREEN();

Procedure

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

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

    The system displays the Assignment Definition window.

  3. Specifying the result variable : Type the name of the result variable next to Result, or click Result to select the variable.
  4. Selecting the Query Screen assignment : Click the pushbutton next to Assignment Type, then click Query Screen.
  5. Adding the statement to the script : Click OK.

    The QUERY_SCREEN statement is added to the script.