bdfp1m2p | Programming Concepts and Reference |
Use this macro to generate a unique key in the SW00SR slot for the
subfile.
Format
- REF=dsectvv
- specifies the file or subfile that you want to access, where
dsectvv is the DSECT name and an optional 2-character version.
- REF=refname
- specifies the file or subfile that you want to access, where
refname is a label that references the DSECT name in one of the
following formats:
- refname
- is the label of an 8-byte field that contains the 6-byte DSECT name and an
optional 2-character version.
- A/refname
- is the label of a 4-byte field that contains the storage address of the
DSECT name and an optional 2-character version.
- FILE=dsect
- specifies the file or subfile that you want to access, where
dsect is the DSECT name.
- NOPGM
- specifies not to change the program stamp in a block when filing
it.
- SUFFIX=char
- allows you to use the same DSECT to map two different areas of storage,
where char is the suffix character.
Entry Requirements
None.
Normal Return
The new unique key value is returned in the 4-byte SW00UKY field of the
SW00SR.
Error Return
Programming Considerations
- The optional 2-character version on the REF parameter allows you to
access more than one subfile in the same file at the same time. For
example, you can code REF=IR71DF01,ALG==C'A' to access subfile A
and REF=IR71DF02,ALG==C'B' to access subfile B.
- If you specify a label, the label must be more than 3 characters
long.
- The contents of register 14 (R14) and R15 cannot be predicted across
a TPFDF macro call.
- The contents of R3, which contains the storage address of the SW00SR
slot, are used by TPFDF macro calls. Do not change the value of R3
between macro calls unless you save the value after each macro call and
restore the value before each macro call.
- The value that is returned in the SW00UKY field of the SW00SR is only
valid immediately after the DBUKY macro is processed. Subsequent TPFDF
macros reuse and overwrite this field.
- In order to use the unique key feature, the file header must be
expanded by 18 bytes.
- See Grouping LRECs Together Using the Unique Key Facility for more information about using unique keys.
Examples
The following example generates a unique key value for file GR34DF.
The value is placed in the SW00UKY field in the SW00SR slot.
DBUKY REF=GR34DF
The following is an example of a header expanded by 18 bytes so that
the unique key feature can be used.
IRXXHDR& DS CL16 STANDARD FILE HEADER
DS CL10 STANDARD TPFDF HEADER
DS CL18 UNIQUE KEY HEADER EXTENSION
Related Macros
DBKEY-Activate a Key List.