| 自由形式構文 | (許可されていない - 使用する前に変数をテストするのではなく、 変数の使用法を MONITOR グループ内でコーディングし、エラーが発生した場合は ON-ERROR で処理する。 『エラー処理命令』を参照。) |
| コード | 演算項目 1 | 演算項目 2 | 結果フィールド | 標識 | ||
|---|---|---|---|---|---|---|
| TESTN | 文字フィールド | NU | BN | BL | ||
同じ標識を複数の条件に使用することができます。 いずれかの条件が存在す れば、標識がオンに設定されます。
TESTN 命令は、使用すると好ましくない結果や例外が生ずる命令 (例えば、 算術演算) を使用する前に、フィールドの妥当性検査を行うために使用 することができます。
詳細については、テスト命令を参照してください。
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
*
* The field values are FieldA = 123, FieldB = 1X4, FieldC = 004,
* FieldD = ␢␢␢, FieldE = ␢1␢3, and FieldF = ␢12.
*
* Indicator 21 is set on because FieldA contains all numeric
* characters.
C TESTN FieldA 21
* Indicator 22 is set on because FieldA contains all numeric
* characters. Indicators 23 and 24 remain off.
C TESTN FieldA 222324
* All indicators are off because FieldB does not contain valid
* numeric data.
C TESTN FieldB 252627
* Indicator 28 is set on because FieldC contains valid numeric data.
* Indicators 29 and 30 remain off.
C TESTN FieldC 282930
* Indicator 33 is set on because FieldD contains all blanks.
* Indicators 31 and 32 remain off.
C TESTN FieldD 313233
* Indicators 34, 35, and 36 remain off. Indicator 35 remains off
* off because FieldE contains a blank after a digit.
C TESTN FieldE 343536
* Indicator 38 is set on because FieldF contains leading blanks and
* valid numeric characters. Indicators 37 and 39 remain off.
C TESTN FieldF 373839