Variable-length fields used by record keys (FROMKEY and TOKEY)
When the number of key fields and a value are used to specify the FROMKEY or TOKEY parameter, the string should include the 2-byte length field for each variable-length key field.
You must pad the variable-length key field with blanks so that keys following the variable-length key field are in the correct position. You can specify the data in hexadecimal format.
When you specify *BLDKEY on the FROMKEY or TOKEY parameter for variable-length key fields, specify the character string without the 2-byte length field. Only the amount of data that is entered for the key value is used for key comparisons. You can specify a zero-length string for variable-length key fields.
Parent topic:
Selecting records by record keys (FROMKEY and TOKEY parameters)