この関数を式の左側で使用すると、可変長フィールドの現在の長さが設定されます。 設定する長さが現在の長さより大きい場合、 古い長さと新しい長さの間のフィールド内の文字数は ブランクに設定されます。
*..1....+....2....+....3....+....4....+....5....+....6....+....7...+.... D*Name++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++ * D city S 40A varying inz('North York') D n1 S 5i 0 * %LEN used to get the current length of a variable-length field: /FREE n1 = %len(city); // Current length, n1 = 10 // %LEN used to set the current length of a variable-length field: %len (city) = 5; // city = 'North' (length is 5) %len (city) = 15; // city = 'North ' (length is 15) /END-FREE
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.