GET_FIELD

Use the GET_FIELD statement to retrieve the contents of a defined field on a 3270 screen and store the value in a specified variable.

If the specified field is not found in the database, the EX_NO_FIELD exception definition script is invoked. By default, the script is abnormally terminated. To handle a failed GET_FIELD statement in a different way, you need to write an exception handler for this condition, as described in EXCEPTION.

Syntax


This picture shows the syntax of the GET_FIELD statement.

Example

GET_FIELD ( Employee_list_screen.Employee_name, name );

Procedure

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

  1. From the Welcome window, click on Applications —> 3270 Servers
  2. Selecting the GET_FIELD statement : Click Statements —> Screen —> Get Field.

    The system displays the Get Field Definition window.

  3. Specifying the field : Type the name of the defined 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.
  4. Specifying the result variable : Type the name of the output result variable next to Result, or click Result to select the variable.
  5. Adding the statement to the script : Click OK.

    The GET_FIELD statement is added to the script.