bdfp1m2g | Programming Concepts and Reference |
Use this macro to replace the following:
- A previously read logical record (LREC) with a new LREC
- The userLREC in the current extended LREC with a new userLREC
- The subLREC in the current extended LREC with a new subLREC.
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.
- R3=address
- specifies the location of the SW00SR slot for this subfile, where
address is the label of a field that contains the address of the
SW00SR slot. Register 3 will be loaded with this address.
- Note:
- Do not use this parameter; it is provided only for migration
purposes. Use the REF parameter to specify the file that you want to
access.
- NEWLREC=newlrec
- replaces a new fixed-length or variable-length LREC, where
newlrec is one of the following:
- A register that contains the address of the LREC
- A label in one of the following formats:
- newlrec
- is the label of a field that contains the LREC.
- A/newlrec
- is the label of a 4-byte field that contains the storage location of the
LREC.
- SUBLREC=sublrec
- replaces a subLREC in the current extended LREC with another subLREC,
where sublrec is one of the following:
- A register that contains the address of the subLREC
- A label in one of the following formats:
- sublrec
- is the label of a field that contains the subLREC.
- A/sublrec
- is the label of a 4-byte field that contains the storage location of the
subLREC.
- USRLREC=usrlrec
- replaces the userLREC in the current extended LREC with another userLREC,
where usrlrec is one of the following:
- A register that contains the address of the userLREC
- A label in one of the following formats:
- usrlrec
- is the label of a field that contains the userLREC.
- A/usrlrec
- is the label of a 4-byte field that contains the storage location of the
userLREC.
- ERROR=spmlbl
- branches to the specified location if a serious error is detected when
processing the macro, where spmlbl is a TPFDF structured program
macro (SPM) label defined with the #LOCA macro. See TPFDF and TPF Structured Programming Macros for more
information about the #LOCA macro. See Identifying Return Indicators and Errors for more information about serious errors.
- ERRORA=asmlbl
- branches to the specified location if a serious error is detected when
processing the macro, where asmlbl is an assembler label. See Identifying Return Indicators and Errors for more information about serious errors.
- NOPGM
- specifies not to change the program stamp in a block when filing
it.
- REG=register
- specifies a register in which to return the address of the current LREC
(this address is contained in SW00SR field SW00REC). You must specify
this parameter for T-type files.
- REGD=register
- specifies a register in which to return the base address of the userLREC
part of an extended LREC.
- SUFFIX=char
- allows you to use the same DSECT to map two different areas of storage,
where char is the suffix character.
Entry Requirements
Before specifying the SUBLREC parameter, you must specify a DBRED macro to
locate the current LREC.
Normal Return
None.
Error Return
See Identifying Return Indicators and Errors for information about how to check the error
indicators.
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.
- When using the DBREP macro with the SUBLREC parameter, the current
extended LREC must contain one (and only one) subLREC. When an extended
LREC contains more than one subLREC, use DBDEL to delete one or more
subLRECs; then call DBADD to add each new subLREC.
- The new LREC can be larger or smaller or the same size as the old LREC (if
you have defined variable-length LRECs in the DSECT).
- If the subfile is UP or DOWN organized, do not use DBREP to insert an LREC
containing key definitions that are different from those in the LREC that it
is replacing. This would destroy the subfile organization.
Instead, use DBDEL to delete the original LREC and DBADD to add the new
LREC. DBADD allows you to specify the keys in the LREC that you add to
the subfile.
- If the subfile uses block index support, the TPFDF product automatically
updates the block index when you replace an LREC.
- For P-type files, the data is copied into the current block.
- The DBREP macro replaces the current LREC. That is, the DBREP macro
does not perform an internal DBRED macro.
- Do not use the DBREP macro if you have changed:
- Any key fields
- Any fields in the LREC that are also used as index key fields.
Instead, delete the old LREC with a DBDEL macro and add a new LREC with
a DBADD macro.
Examples
- The following example replaces the current LREC in file GR23DF with the
LREC GR23REC.
DBREP REF=GR23DF,NEWLREC=GR23REC
- The following example replaces a subLREC in the current extended LREC with
the subLREC at the address contained in register 5.
DBREP REF=GR39DF,SUBLREC=R5
- The following example replaces a subLREC at the same time as a
userLREC.
DBREP REF=GR39DF,USRLREC=GR39REC,SUBLREC=A/EBW000
Related Macros