Example: build-key function

The example in this topic shows the usages of various parameters of the build-key function.

Key field number Type Length Decimal precision Value
1 CHAR 6   KEN
2 ZONED 6 2 54.25
3 BINARY 4 1 10.1
You can specify the FROMKEY (or TOKEY) parameter as follows:
FROMKEY( 2  x'D2C5D5404040F0F0F5F4F2F50065')
Or, you can use the *BLDKEY value and specify the FROMKEY as follows:
FROMKEY(*BLDKEY    (KEN 54.25 10.1))
Another example using key fields 1 and 2 is:
FROMKEY(2  'KEN    005425')
Or, you can specify the *BLDKEY value:
FROMKEY(*BLDKEY    (KEN 54.25))