ヌル値可能キー・フィールドがある場合、
*START または *END を指定した SETLL 命令を使用して、ファイルの
先頭または終わりに位置付けることができます。 
ヌル値可能キー・フィールドがある場合には、KFLD 命令の演算項目 2 中の 標識を指定し、キー順入力命令の前に標識をオンに設定することによって、 ヌル値を含むレコードを検索することができます。 ヌル・キーを選択する必要がない場合には、標識をオフに設定します。
KFLD 命令の演算項目 2 が指定されていない場合、
そのキーについてはヌル・キー・バイト・マップ情報はゼロに設定されます。 
ヌル値可能キー・フィールドを含むレコード様式を CHAIN、SETLL、READE、または READPE 命令で使用するときに、 キーを指定するために %KDS データ構造を使用する場合、 ヌル・キー・バイト・マップ情報は、%KDS の引数として指定されたデータ構造のサブフィールドのヌル属性から入手されます。
ヌル値可能キー・フィールドを含むレコード様式を CHAIN、SETLL、READE、または READPE 命令で使用するときに、 キー・フィールドのリストを使用する場合、 ヌル・キー・バイト・マップ情報は、指定されたキーのヌル属性から入手されます。
図 1 および 図 2 は、ヌル・キーによってレコードを位置付け、 検索するためにどのようにキー付き命令が使用されるかを示しています。
// 下記の File1 に、3 つのキー・フィールド Key1、Key2、および Key3 からなる
// 複合キーを使用する、レコード Rec1 が含まれていると想定します。Key2
// および Key3 はヌルにすることができ、Key1 はヌルにすることができません。
// それぞれのキー・フィールドの長さは 2 文字です。
*..1....+....2....+....3....+....4....+....5....+....6....+....7....+..
FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords++++++++++++++++++++++++++
FFile1 IF E DISK
// ファイルのためのキーを含む 2 つのデータ構造を定義します。
// 両方のデータ構造のサブフィールド Key2 および Key3 は、
// ヌルにすることができます。
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D Keys DS LIKEREC(Rec1 : *KEY)
D OtherKeys DS LIKEDS(keys)
// ファイルの入力フィールドが入ったデータ構造を定義します。
// データ構造のサブフィールド Key2 および Key3 は、
// ヌルにすることができます。
D File1Flds DS LIKEREC(Rec1 : *INPUT)
/free // The null indicator for Keys.Key2 is ON and the
// ヌル標識は ON で、Keys.Key3 のヌル標識は OFF です。
// File1 は、キー値が 'AA??CC' 以上になっている、
// 次のレコードに位置付けられます
// (この例では、?? は NULL を表すために
// 使用されています)。
// %NULLIND(Keys.Key2) が ON になっているため、
// 検索引数 Keys.Key2 内の実際の内容は無視されます。
// File1 内に、Key1 が 'AA'、Key2 がヌル、Key3 が 'CC' になっている
// レコードが存在する場合、%EQUAL(File1) は true になります。
Keys.Key1 = 'AA';
Keys.Key3 = 'CC';
%NULLIND(Keys.Key2) = *ON;
%NULLIND(Keys.Key3) = *OFF;
SETLL %KDS(Keys) Rec1;
// 下記の CHAIN 命令は、Key1 が 'JJ'、Key2 が 'KK'、
// Key3 がヌルになっているレコードを検索します。
// %NULLIND(OtherKeys.Key3) が ON になっているため、OtherKeys.Key3
// 内の値 'XX' は使用されません。つまり、'JJKKXX' という
// キー値のレコードが File1 内に実際に存在する場合にも、
// そのレコードは使用されません。
OtherKeys.Key3 = 'XX';
%NULLIND(Keys.Key3) = *ON;
CHAIN ('JJ' : 'KK' : OtherKeys.Key3) Rec1;
// 以下の CHAIN 命令は、部分キーを検索引数として使用します。
// この命令は、Key1 が 'NN'、Key2 がヌル、Key3 が
// ヌル値を含む任意の値になっているレコードを検索します。
// 検索されたレコードは File1Flds データ構造に入ります。
// これにより、(CHAIN でレコードが検出された場合に)
// File1Flds.Key2 にはヌル・フラグが立てられ、
// File1Flds.Key3 はこの命令で変更されるように
// なります。
Keys.Key1 = 'NN';
%NULLIND(Keys.Key2) = *ON;
CHAIN %KDS(Keys : 2) Rec1 File1Flds;
* Using the same file as the previous example, define two
* key lists, one containing three keys and one containing
* two keys.
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.
C Full_Kl KLIST
C KFLD Key1
C KFLD *IN02 Key2
C KFLD *IN03 Key3
C Partial_Kl KLIST
C KFLD Key1
C KFLD *IN05 Key2
*
* *IN02 is ON and *IN03 is OFF for the SETLL operation below.
* File1 will be positioned at the next record that has a key
* that is equal to or greater than 'AA??CC' (where ?? is used
* in this example to indicate NULL)
*
* Because *IN02 is ON, the actual content in the search argument
* for Key2 will be ignored.
*
* If a record exists in File1 with 'AA' in Key1, a null Key2, and
* 'CC' in Key3, indicator 90 (the Eq indicator) will be set ON.
*
C MOVE 'AA' Key1
C MOVE 'CC' Key3
C EVAL *IN02 = '1'
C EVAL *IN03 = '0'
C Full_Kl SETLL Rec1 90
*
* The CHAIN operation below will retrieve a record with 'JJ' in Key1,
* 'KK' in Key2, and a null Key3. Again, because *IN03 is ON, even
* if the programmer had moved some value (say 'XX') into the search
* argument for Key3, 'XX' will not be used. This means if File1
* actually has a record with a key 'JJKKXX', that record will not
* be retrieved.
*
C MOVE 'JJ' Key1
C MOVE 'KK' Key2
C EVAL *IN02 = '0'
C EVAL *IN03 = '1'
C Full_Kl CHAIN Rec1 80
*
* The CHAIN operation below uses a partial key as the search argument.
* It will retrieve a record with 'NN' in Key1, a null key2, and any
* value including a null value in Key3.
*
* In the database, the NULL value occupies the highest position in
* the collating sequence. Assume the keys in File1 are in ascending
* sequence. If File1 has a record with 'NN??xx' as key (where ??
* means NULL and xx means any value other than NULL), that record
* will be retrieved. If such a record does not exist in File1, but
* File1 has a record with 'NN????' as key, the 'NN????' record will
* be retrieved. The null flags for Key2 and Key3 will be set ON
* as a result.
*
C MOVE 'NN' Key1
C SETON 05
C Partial_Kl CHAIN Rec1 70