LEN キーワードに関する規則:
- 「データ・タイプ」記入項目には、データ・タイプ A、C、または G を指定する必要があります。
- 「長さ」記入項目を指定している場合や、サブフィールドで「開始位置」記入項目と「終了位置」記入項目を指定している場合は、LEN キーワードを指定することはできません。 9,999,999 を超える長さを指定するには、LEN キーワードを使用する必要があります。
- LEN キーワードを使用して、LIKE 定義の長さ調整をすることはできません。
- 長さは文字単位で指定します。UCS-2 定義および図形定義の場合、1 文字は 2 バイトで表されます。
図 1. LEN キーワードの例
* Use the LEN keyword to define a standalone field of one million
* characters and a standalone array of 100 characters.
D paragraph S A LEN(1000000) VARYING(4)
D splitPara S A LEN(100) DIM(10000)
* Use the LEN keyword to define a data structure of length 16000000,
* and to define three subfields. Since the lengths of the parameters
* are less than 9999999, they can be defined using from-and-to, or length
* notation, or the LEN keyword.
D info DS LEN(16000000)
D name G LEN(100) OVERLAY(info : 14000001)
D address 5000G OVERLAY(info : 14000301)
D country 1 40G
* Use the LEN keyword to define a prototype that returns a varying
* UCS-2 value that is up to 5000 UCS-2 characters long, and to define
* two alphanumeric parameters. Since the lengths of the parameters
* are less than 9999999, they can be defined either using length notation
* or the LEN keyword.
D getDftDir PR C VARYING LEN(5000)
D usrprf A LEN(10) CONST
D type 5A CONST