Each field on a text form has a modified data tag, which is a status value that indicates whether the user changed the form field when the form was last presented. In relation to CICS®, one benefit of the modified data tag is that network traffic is reduced because the transfer of data from user to program includes only modified fields.
As described later, a modified data tag is distinct from the modified property for the field, which is set in the program and which presets the value of the modified data tag.
if (field is modified)
;
end
For details, see Logical expressions for Text UI forms.The user sets the modified data tag by typing or deleting a character in the field. The modified data tag stays set, even if the user, before submitting the form, returns the field content to the value that was presented.
Validation involves two phases. Phase I involves properties such as InputRequired, as well as validations related to data tables. Phase II runs validator functions. When a form is re-displayed due to an error in phase I, the modified data tag is still set to YES in every field that was modified after the program ran converse or show. However, when a form is re-displayed due to an error in phase II, the modified data tag is no longer on in any fields at all unless a validator function reset the tag.
if (field is modified)
;
end
If you try to test the modified data tag for a field
before your logic presents the form for the first time, an error occurs
at run time.The form as a whole is considered to be modified if the modified data tag is set to YES for any of the variable form fields. If you test the modified status of a form that was not yet presented to the user, the test result is FALSE.
The following logic shows the result of various tests:
// tests false because a converse statement
// was not run for the form
if (form01 is modified)
;
end
// causes a runtime error because a converse
// statement was not run for the form
if (field01 is modified)
;
end
// assume that the user modifies both fields
converse form01;
// tests true
if (field01 is modified)
;
end
// tests true
if (field02 is modified)
;
end
// sets the modified property to no
// at the next converse statement for the form
set field01 initialAttributes;
// sets the modified property to yes
// at the next converse statement for the form
set field02 initialAttributes;
// tests true
// (the previous set statement takes effect only
// at the next converse statement for the form
if (field01 is modified)
;
end
// assume that the user does not modify either field
converse form01;
// tests false because the program set the modified
// data tag to no, and the user entered no data
if (field01 is modified)
;
end
// tests true because the program set the modified
// data tag to yes
if (field02 is modified)
;
end
// assume that the user does not modify either field
converse form01;
// tests false
if (field01 is modified)
;
end
// tests false because the presentation was not
// the first, and the program did not reset the
// field properties to their initial values
if (field02 is modified)
;
end