DBTRD-read a subfile from an input tape to main storage

Use this macro to read a subfile from an input tape or sequential data set to main storage.

Format

Read syntax diagramSkip visual syntax diagram DBTRD REF= dsectvvREF= refname,FILE= dsectFILE= dsect,R3= address ,TAPE= tapename ,ERROR= spmlbl,ERRORA= asmlbl ,REG= register ,SUFFIX= char
REF=dsectvv
specifies the file that you want to access, where dsectvv is the 6-character DSECT name and an optional 1- or 2-character suffix.
REF=refname
specifies the name associated with the file that you want to access, where refname is a label that references the name in one of the following formats:
refname
is the label of an 8-byte field that contains the reference name.
A/refname
is the label of a 4-byte field that contains the storage address of an 8-byte field that contains the reference name.

The reference name can be any 8-byte value that is unique for the current ECB.

FILE=dsect
specifies the file or subfile that you want to access, where dsect is the 6-character 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.
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.
REG=register
specifies a register in which to return the address of the prime block (this address is contained in SW00SR field SW00PCA).
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

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.
  • The DBTRD macro reads one subfile at a time. After you call the DBTRD macro, you must then call the DBTLD macro before reading another subfile. (You can use the SKIP parameter with the DBTLD macro to ignore the subfile.)
  • If you use the DBTRD macro in a commit scope, a rollback of the commit scope will not restore the position of the tape. See Commit Scopes for more information about commit scopes.
  • You cannot use this macro with P-type files unless the forward chain field is a 4-byte address located at displacement 8 from the start of the block.

Examples

The following example reads subfile GR54DF from tape TST to main storage.

DBTRD REF=GR54DF,TAPE=TST