bdfp1m2a | Programming Concepts and Reference |
Use this macro to check if a SW00SR slot exists. If the slot exists,
the function returns the base address of the SW00SR slot.
You can use this macro to test if a particular subfile is open.
Format
- FIRST
- inserts the address of the first SW00SR slot with an open subfile in your
application program in register 3 (R3). R14 points to the 8-byte
location containing the reference name for the file.
- NEXT
- inserts the address of the next SW00SR slot with an open subfile in your
application program in register 3 (R3). R14 points to the 8-byte
location containing the reference name for the file.
- 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.
- 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.
- NEWREF=newrefn
- changes the reference name of the file specified with the REF parameter,
where newrefn is one of the following:
- An explicit term that represents the new reference name
- A label in one of the following formats:
- newrefn
- is the label of an 8-byte field that contains the new reference
name.
- A/newrefn
- is the label of a 4-byte field that contains the storage address of the
8-byte field containing the new reference name.
- 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.
Entry Requirements
None.
Normal Return
The base address of the SW00SR slot is returned in register 3 (R3).
Error Return
If the required SW00SR slot is not found, R3 is set to zero. You can
test the return value of R3 in the program, or use the ERROR or ERRORA
parameters to cause the program to branch if the TPFDF product cannot find a
selected SW00SR.
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.
Examples
The following example locates the open SW00SR slot of IWA3DF (if it exists)
and inserts the address of the current LREC for this SW00SR slot in R2.
DBIFB REF=IWA3DF,REG=R2
Related Macros
DBOPN-Open a Subfile.