bdfp1m2h | Programming Concepts and Reference |
Use this macro to retain the file address and displacement in a block of
the current logical record (LREC). You can read this LREC later in your
application program by using a DBRED macro with a PREVIOUS, STACK, or STACKREF
parameter.
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.
- 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.
- STACK=stkloc
- retains an LREC, where stkloc is the location of a 10-byte field
that contains the details about the LREC. Specify one of the
following:
- A register that points to the location of the field that contains the LREC
details.
- A label in one of the following formats:
- stkloc
- is the label of the field that contains the LREC details.
- A/stkloc
- is the label of a 4-byte field that contains the storage address of that
contains the LREC details.
The 10-byte field contains the following information:
- 4 bytes for the current file address
- 4 bytes for the current core address
- 2 bytes for the next available byte (NAB) value.
- Note:
- Where possible, use the STACKREF parameter.
- STACKREF=stkval
- retains an LREC, where stkval is a value assigned to the
LREC. Specify one of the following:
- A 4-byte value
- A register that contains the 4-byte value
- An absolute value that does not exceed 4-bytes.
The retained information consists of the following 14-bytes:
- 4 bytes for the current file address
- 4 bytes for the current core address
- 2 bytes for the next available byte (NAB) value
- 4 bytes for the STACKREF value.
- Note:
- Where possible, use the STACKREF parameter instead of the STACK
parameter.
- 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 using this macro, you must open the subfile using the DETAC or HOLD
parameter of the DBOPN macro.
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.
- If you do not specify the STACK or STACKREF parameter, the details of only
the current LREC are retained.
- To ensure that an LREC is retrieved accurately when you use the DBRED
macro, do not use the DBRET macro with the STACK and STACKREF parameters
specified on the same open file. If you do, the wrong LREC could be
retrieved. You must close and reopen the file each time you alternate
between specifying the STACK and STACKREF parameters.
Examples
Related Macros
DBRED-Read a Logical Record.