DBSETK-setting up a key in a key list
Use this macro to set up a key list. See Specifying Logical Records (LRECs) Using Keys for more information about key lists.
Format
Note: Parameters can be entered as labels, registers, or immediate values as described in the
following section. (Immediate values are assumed to be decimal unless otherwise specified.) For
example:
- Label
- DIS=EBW000
- Register
- DIS=R5
- Immediate value
- DIS=I/16
- BASE=basereg
- specifies the base address of the key list, where basereg is a register that contains the address. If you do not specify this parameter, it is assumed that the register with addressability to SW01SR is set up so that the SW01SR DSECT overlays the key to be updated.
- KEYNUM=keynum
- specifies the number of the key that you are setting up, where keynum is the label of an area, a register, or an immediate value that contains a number from 1-180, depending on the type of key list. See Specifying Logical Records (LRECs) Using Keys for more information about key lists.
- DIS=displacement
- specifies the displacement of the key field in the LREC from the start of the LREC, where displacement is the label of an area, a register, or an immediate value that contains the displacement in bytes. For example, if the LREC is a variable-length LREC and you want to specify the LREC ID as the key field, the value is 2. The maximum displacement you can specify with this macro is 255.
- LEN=length
- specifies the length of the key field in the LREC, where length is the label of an area, a register, or an immediate value that contains the length in bytes. For example, if you want to specify the LREC ID as the key field, the value is 1. If you are using a mask field, length must be 1.
- MSK=mask
- specifies a mask value or 1-byte search argument, where mask is the label of an area, a register, or an immediate value that contains a 1-byte mask or a 1-byte search argument.
- SEA=searchaddr
- specifies a search argument, where searchaddr is the label of an area that contains the search argument or a register that contains the address of the search argument.
- CON=condition
- specifies the condition that must exist for the match to be successful, where
condition is the label of an area, a register, or an immediate value that contains the value. Use
one of the following values if you specify the #DF_CONST, #DF_CHAR, or #DF_PACKED value for the ID1
parameter:
- #DF_GT
- specifies that the LREC key field is greater than the search argument. The corresponding hexadecimal value is X'20'.
- #DF_GE
- specifies that the LREC key field is greater than or equal to the search argument. The corresponding hexadecimal value is X'40'.
- #DF_EQ
- specifies that the LREC key field is equal to the search argument. The corresponding hexadecimal value is X'70'.
- #DF_NE
- specifies that the LREC key field is not equal to the search argument. The corresponding hexadecimal value is X'80'.
- #DF_LE
- specifies that the LREC key field is less than or equal to the search argument. The corresponding hexadecimal value is X'B0'.
- #DF_LT
- specifies that the LREC key field is less than the search argument. The corresponding hexadecimal value is X'D0'.
Use one of the following values if you specify the #DF_MASK value for the ID1 parameter:
- #DF_NM
- specifies that the result is not mixed ones and zeros (that is, all zeros or all ones are found). The corresponding hexadecimal value is X'10'.
- #DF_NO
- specifies that the result is not all ones. The corresponding hexadecimal value is X'40'.
- #DF_Z
- specifies that the result is all zeros. The corresponding hexadecimal value is X'70'.
- #DF_NZ
- specifies that the result is not all zeros. The corresponding hexadecimal value is X'80'.
- #DF_M
- specifies that the result is mixed ones and zeros. The corresponding hexadecimal value is X'B0'.
- #DF_O
- specifies that the result is all ones. The corresponding hexadecimal value is X'E0'.
- ID1=optbyte1
- specifies the settings for the first option byte, where optbyte1 is the label of an area, a
register, or an immediate value that contains the indicators for the first option byte. Use one or
more of the following values:
- #DF_DOWN
- specifies that the subfile is DOWN organized on this key field (bit 0 = 1).
- #DF_UP
- specifies that the subfile is UP organized on this key field (bit 1 = 1).
- #DF_KEYS
- specifies that you want to use default keys (bit 2 = 1).
- #DF_USR
- specifies the userLREC portion of an extended LREC (bit 3 = 1).
- #DF_CONST
- specifies that the MSK parameter contains a 1-byte search argument (bit 4 = 1).
- #DF_PACKED
- specifies that the search argument is a variable-length packed string (bit 5 = 1).
- #DF_MASK
- specifies that the MSK parameter contains a 1-byte mask (bit 6 = 1).
- #DF_NOORG
- specifies that the subfile is not organized on this key field. This value is equated to X'00'.
- #DF_CHAR
- specifies that the search argument is a variable-length character string. This value is equated to X'00'.
- ID2=optbyte2
- specifies either a Boolean connector or a global modification operation, where
optbyte2 is the label of an area, a register, or an immediate value that contains the indicators for
the second option byte.
Use one of the following values for a Boolean connector:
- #DF_OR
- specifies the OR connector (bit 0 = 1).
- #DF_AND
- specifies the AND connector (bit 1 = 1).
- #DF_ORIF
- specifies the ORIF connector (bit 4 = 1).
- #DF_ANDIF
- specifies the ANDIF connector (bit 5 = 1).
Use one of the following values for a global modification operation:
- #DF_MVI
- moves the value contained in SW01MSK into the LREC at the displacement specified by SW01DIS. The corresponding hexadecimal value is X'04'.
- #DF_MVC
- moves the character string whose address is in SW01SEA into the LREC, starting at the displacement specified by SW01DIS for the length contained in SW01LEN. The corresponding hexadecimal value is X'08'.
- #DF_FILL
- propagates the character contained in SW01MSK into the LREC, starting at the displacement specified by SW01DIS for the length contained in SW01LEN. The corresponding hexadecimal value is X'0C'.
- #DF_OI
- performs an OR-Immediate (OI) operation on the byte in the LREC at the displacement in SW01DIS by using the value specified in SW01MSK. The corresponding hexadecimal value is X'10'.
- #DF_OC
- performs an OR-Character (OC) operation in the LREC beginning on the byte whose displacement is specified in SW01DIS for a length given in SW01LEN by using the value whose address is given in SW01SEA. The corresponding hexadecimal value is X'14'.
- #DF_NI
- performs an AND-Immediate (NI) operation on the byte in the LREC at the displacement in SW01DIS by using the value specified in SW01MSK. The corresponding hexadecimal value is X'18'.
- #DF_NC
- performs an AND-Character (NC) operation in the LREC beginning on the byte whose displacement is specified in SW01DIS for a length given in SW01LEN by using the value whose address is given in SW01SEA. The corresponding hexadecimal value is X'1C'.
- #DF_XI
- performs an Exclusive OR-Immediate (XI) operation on the byte in the LREC at the displacement in SW01DIS by using the value specified in SW01MSK. The corresponding hexadecimal value is X'20'.
- #DF_XC
- performs an Exclusive OR-Character (XC) operation in the LREC beginning on the byte whose displacement is specified in SW01DIS for a length given in SW01LEN by using the value whose address is given in SW01SEA. The corresponding hexadecimal value is X'24'.
- #DF_ADD
- adds the fullword value whose address is in SW01SEA to the fullword value in the LREC whose displacement is specified by SW01DIS. The corresponding hexadecimal value is X'28'.
- #DF_AH
- adds the halfword value whose address is in SW01SEA to the halfword value in the LREC whose displacement is specified by SW01DIS. The corresponding hexadecimal value is X'2C'.
- #DF_SUB
- subtracts the fullword value whose address is in SW01SEA to the fullword value in the LREC whose displacement is specified by SW01DIS. The corresponding hexadecimal value is X'30'.
- #DF_SH
- subtracts the halfword value whose address is in SW01SEA to the halfword value in the LREC whose displacement is specified by SW01DIS. The corresponding hexadecimal value is X'34'.
- #DF_CNT
- increments a fullword counter whose address is in SW01SEA. The application is responsible for initializing the counter before the global modification operation. The corresponding hexadecimal value is X'38'.
- #DF_CTH
- increments a halfword counter whose address is in SW01SEA. The application is responsible for initializing the counter before the global modification operation. The corresponding hexadecimal value is X'3C'.
- #DF_SUM
- adds the fullword value in the LREC at the displacement specified in SW01DIS to the fullword sum whose address is in SW01SEA. The sum must be initialized before the global modification operation. The corresponding hexadecimal value is X'40'.
- #DF_SMH
- adds the halfword value in the LREC at the displacement specified in SW01DIS to the halfword sum whose address is in SW01SEA. The sum must be initialized before the global modification operation. The corresponding hexadecimal value is X'44'.
- #DF_MAX
- finds the maximum value of the fullword value in the LREC at the displacement specified by SW01DIS and the current fullword maximum whose address is in SW01SEA. The new maximum value is stored at the address in SW01SEA. The value in SW01SEA does not have to be initialized before the global modification operation. The corresponding hexadecimal value is X'48'.
- #DF_MXH
- finds the maximum value of the halfword value in the LREC at the displacement specified by SW01DIS and the current halfword maximum whose address is in SW01SEA. The new maximum value is stored at the address in SW01SEA. The value in SW01SEA does not have to be initialized before the global modification operation. The corresponding hexadecimal value is X'4C'.
- #DF_MIN
- finds the minimum value of the fullword value in the LREC at the displacement specified by SW01DIS and the current fullword minimum whose address is in SW01SEA. The new minimum value is stored at the address in SW01SEA. The value in SW01SEA does not have to be initialized before the global modification operation. The corresponding hexadecimal value is X'50'.
- #DF_MNH
- finds the minimum value of the halfword value in the LREC at the displacement specified by SW01DIS and the current halfword minimum whose address is in SW01SEA. The new minimum value is stored at the address in SW01SEA. The value in SW01SEA does not have to be initialized before the global modification operation. The corresponding hexadecimal value is X'54'.
Entry requirements
The SW01SR DSECT must be addressable by a register without a suffix. If you specify the BASE parameter, the SW01SR DSECT must be addressable without a suffix by the register passed to the BASE parameter.
Normal return
None.
Error return
None.
Programming considerations
- The contents of register 14 (R14) and R15 cannot be predicted across a TPFDF macro call.
- Registers R14 and R15 cannot be used when a register is specified as a parameter.
- This macro does not set field SW01NKY. This has to be done on a separate instruction.
- A key list field in the SW01SR DSECT is modified or filled in only if its corresponding parameter is supplied.
- If you specify a label for the KEYNUM, DIS, or LEN parameters, TPFDF assumes the area is a 2-byte location. If you specify a label for the CON, MSK, ID1, or ID2 parameters, TPFDF assumes the area is a 1-byte location.
Examples
See Using a Key List with the DBSETK Macro for an example of using the DBSETK macro.
