DBTAB: Access database definition (DBDEF) tables
Use this system macro to access the database definition (DBDEF) tables
Last updated
- Changed in 2022 (information only; no code change).
- Changed in 2020 (information only; no code change).
- Changed for PUT08.
- Changed for PUT07.
- Changed for PUT06.
- Changed for PUT00.
Format
- AMODE
- Specifies the addressing mode that is being used when the macro is called. Specify one of the following values:
- amodedef
- The value that is specified by the AMODE parameter on the BEGIN macro. If the AMODE parameter is not specified on the BEGIN macro, the default value is 31.
- 31
- Indicates that 31-bit addressing mode is in use.
- 64
- Indicates that 64-bit addressing mode is in use.
- label
- A symbolic name assigned to the macro statement.
- DBDEF=reg
- Returns the address of the base of the DBDEF index table to a specified register, reg.
- ID=fileid
- Specifies the file identifier (ID) for a specific file, where fileid is the label of a 2-byte field containing the file ID.
- ERROR=errlbl
- Specifies the label that you want to branch to if the specified file ID is not defined in the DBDEF tables.
- FVN=filever
- Specifies the file version number of the file specified by the ID parameter, where filever is the label of a 1-byte field containing the file version number. The file version number must be in the range of 0 - 254.
- SLOT
- Specifies one of the following:
- YES
- Returns the address of the slot that contains the address of the DBDEF table for a specific file ID.
- NO
- Returns the address of the DBDEF table for a specific file ID.
- REG=register
- Specifies a register, register, in which the requested address is returned.
- FILETYP=filetype
- Returns the address of a DBDEF table for a specific record type, where filetype is the label of a 2-byte field containing the record type. The record type is represented with a numeric value defined in the z/TPF SYSEQC macro.
Entry requirements
None.
Return conditions
The address requested is returned in the specified register.
Programming considerations
- For information about macro register conventions, see Assembler program register conventions.
- All data, address reference fields, and storage areas that are passed to the z/TPFDF product assembler macros must reside below 2 GB in storage unless otherwise noted.
- The DBTAB macro modifies register 14 (R14). If you specify the FVN parameter, this macro modifies R7.
- If you want to access a copy of the DBDEF tables that takes multiple database function (MDBF) considerations and subsystem user (SSU) overrides into account, use the DFSSU macro.
- Figure 1 shows the different areas
that you can access with the DBTAB macro.
Figure 1. Areas in the database definition (DBDEF) table accessed by the DBTAB macro
Examples
- The following example returns the base of the DBDEF index table
to R15.
DBTAB DBDEF=R15
- The following example returns the base of a specific file ID to R15. In this example, the file
ID is located in the BFAID field and the file version is located in the EBX000 field.
DBTAB ID=BFAID,FVN=EBX000,ERROR=NODBDEF
- The following example verifies the existence of the database
subtable and sets up the database name in the EBX000 field. The DBDEF base of the specific file ID
is returned in R6. In this example, the file ID is located in the EBW000 field and the file version
is located in the EBW002 field.
DBTAB ID=EBW000,FVN=EBW002,ERROR=NODBDEF,REG=R6 #IF CLC,SW02DBS,NE,=H’0’ Does database subtable exist? AH R6,SW02DBS Add offset to subtable #IF CLI,SW02DBN,NE,X’00’ Is DBN defined? MVC EBX000(L’SW02DBN),SW02DBN Yes, set up DBN #EIF #EIF