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.
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:
- From the Welcome window, click on Applications
—> 3270 Servers
- Selecting the CHECK_ ATTRIBUTE statement : Click Statements
—>Conditional.
The system displays the Conditional
Definition window.
- 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
- If the statement is to test when the CHECK_ATTRIBUTE condition
is not true, click the NOT pushbutton.
- Defining the condition : Click condition.
The
system displays the Condition Definition window.
- Click the pushbutton next to Condition Type,
then click Check Field Attribute.
The
Condition Definition window changes appropriate to the CHECK_ATTRIBUTE
statement definition.
- 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.
- 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.
- Click OK.
The Conditional Definition
window displays the CHECK_ATTRIBUTE statement in the condition field.
- 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.