切り捨てオプション

切り捨てオプションを使用して、特定のデータ項目の切り捨てを制御できます。

Enterprise Developer では、ccbl(Windows) または ccbl32 および ccbl64(UNIX) をコマンド ラインまたは ACUOPT コンパイラ指令で使用する際に、次のコンパイラ オプションがサポートされます。

オプション 定義
-Dz All binary and packed-decimal data types ignore their PICTURE when determining the largest value they can hold. The PICTURE is not used when moving to a nonnumeric destination (the largest possible value determines the number of digits moved instead).
-noTRUNC All binary data types ignore their PICTURE when determining the largest value they can hold. However, the PICTURE is used when moving data from a binary number to a nonnumeric data item. The name of this option is similar to the name used by some other COBOL systems that behave this way.
-truncANSI すべての ANSI COBOL ルールが使われます。各数値データ項目には、PICTURE のサイズまでの値が格納されます。少数の USAGE 型には例外があります (COMP-X、COMP-5 など)。データ項目が MOVE 文のターゲットである場合、PICTURE によって許容される値より大きい値は標準サイズ ルールを使用して切り捨てられますが、COMP-5 項目の場合は、値を文字データ項目に移動するときその PICTURE を使用します。算術オーバーフローの結果 (SIZE 指定なし) は未定義です。

説明:

JVM COBOL では -Dz 切り捨てオプションはサポートされていません。