テキスト書式の各フィールドには、変更データ・タグ があります。このタグは、前回書式を表示した際にユーザーが書式に変更を行ったかどうかを示す状況値です。 CICS® に関して変更データ・タグが持つ利点の 1 つは、ネットワーク・トラフィックが削減されることです。 これは、ユーザーからプログラムへのデータ転送に、変更されたフィールドのみが含まれるようになるためです。
後述するように、変更データ・タグとフィールドの modified プロパティーは別のものです。このプロパティーは、変更データ・タグの値を事前設定するために、プログラム内に設定されるものです。
if (field is modified)
;
end
詳しくは、テキスト UI 書式の論理式を参照してください。変更データ・タグは、フィールド内で文字を入力したり削除したりすることによって設定します。 書式を送信する前にフィールドの内容を表示されたときの値に戻した場合でも、変更データ・タグは設定されたままです。
検証には 2 つのフェーズが含まれます。フェーズ I には、InputRequired などのプロパティー、およびデータ・テーブルに関連した検証が含まれます。フェーズ II ではバリデーター関数を実行します。フェーズ I でのエラーにより書式が再表示された場合でも、プログラムが converse または show を実行した後で変更されたすべてのフィールドで、変更データ・タグは YES に設定されています。 ただし、フェーズ II でのエラーにより書式が再表示された場合は、バリデーター関数がタグをリセットした場合を除いてどのフィールドでも変更データ・タグはオンになっていません。
if (field is modified)
;
end
ロジックで最初に書式を表示する前に、フィールドの変更データ・タグをテストしようとすると、実行時にエラーが発生します。いずれかの可変書式フィールドの変更データ・タグが YES に設定されている場合、その書式全体が変更されていると見なされます。 ユーザーに対してまだ表示されなかった書式の変更状況をテストした場合、そのテスト結果は FALSE です。
以下のロジックは、さまざまなテストの結果を示したものです。
// 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