bdfp1m2aProgramming Concepts and Reference

DBIFB-Check a SW00SR Slot

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:

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

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.