CHECK_ATTRIBUTE

Use the CHECK_ATTRIBUTE statement to check whether the specified attribute applies to a specified selected field. The statement returns TRUE or FALSE.

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 CHECK_ATTRIBUTE 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 CHECK_ATTRIBUTE statement.

Examples

IF CHECK_ATTRIB ( Emp_screen.Emp_name, HIDDEN )
.
.
.
ENDIF
WHILE NOT CHECK_ATTRIB ( Reports_to_screen.Mgr_phone_num, PROTECTED )
.
.
.
ENDWHILE

Procedure

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

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

    The system displays the Conditional Definition window.

  3. Selecting the conditional statement : Click the conditional statement that is to use CHECK_ATTRIBUTE as a condition:
    • IF condition THEN
    • ELSEIF condition THEN
    • WHILE condition DO
  4. If the statement is to test when the CHECK_ATTRIBUTE 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 Check Field Attribute.

    The Condition Definition window changes appropriate to the CHECK_ATTRIBUTE 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. Specifying the attribute : Type the attribute you are checking for in the Attribute field, or click Attribute to display the Field Attributes window to select an attribute.
  9. Click OK.

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

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

    The CHECK_ATTRIBUTE statement is added to the script as a condition in the selected conditional statement.