bdfg1m0cGeneral Information

TPFDF Components

The TPFDF product provides the following software functions:

Database definition (DBDEF) tables contain detailed information about each file in the database. Application programs directly or indirectly use DBDEF tables.

When opening a file, the TPFDF product allocates a SW00SR slot in a work area called the database interface block (DBIFB). The next TPFDF macro or function in the application program copies relevant information from the DBDEF table into the SW00SR slot. This SW00SR slot, therefore, contains a working copy of the file definitions while a file remains open. The SW00SR slot is closed when the file is closed. Figure 2 shows how the DBDEF table relates to the other components of the TPFDF product.

Figure 2. Relationship between the DBDEF Table and Other TPFDF Components


DBDEF Tables, DBDEF Macros, and DSECT Macros

Each DBDEF table is generated using:

DBDEF tables provide central definitions for the database. The DBDEF tables hold information about the location, organization, and processing attributes of the database. Information about the characteristics of a file are also held in the DBDEF tables.

There is one DBDEF table for each file ID defined to the TPFDF product. For each file ID, there is also an assembler DSECT macro. This DSECT is designed by using samples provided with the TPFDF product.

The database administrator codes processing information about a file in a DBDEF macro. This information includes the file ID and the name of the DSECT. Application programmers use this name to reference the file.

A DBDEF table is the assembled output of the DBDEF macro. Load the DBDEF table to the online system. Once loaded, the table is available as read-only information to the TPFDF product. It is available both to the programs that interpret the TPFDF macros, functions, and utilities.

Database Interface Block (DBIFB)

When an application opens a file using the DBOPN macro or dfopn function, the TPFDF product creates a work area called the database interface block (DBIFB). The DBIFB contains several slots known as SW00SR slots, each of which contains information about an individual subfile.   When a subfile or file is opened, the TPFDF product allocates a SW00SR slot in the DBIFB. The next macro or function moves the relevant information from the DBDEF table into the SW00SR slot. As processing continues, the TPFDF product returns information to the application program using various fields in the SW00SR slot. Each SW00SR slot contains the following fields that must not be changed:

Field
Description

SW00CCA
Core address of the current block.

SW00CFA
File address of the current block.

SW00FAD
File address of the prime block.

SW00ITM
Base address of the current LREC.

SW00PCA
Core address of the prime block.

SW00REC
This field also provides the base address of the current LREC.

SW00RTN
Return code from the last TPFDF macro call.

SW00RT1
Error information from the last TPFDF macro call.

SW00RT2
Additional error information from the last TPFDF macro call.

SW00SEQ
File update sequence code that can be moved into a work area for a later integrity check with DBRST macro or dfrst function.

SW00UKY
Last unique key supplied by the TPFDF product.

SW00WCC
Area used to hold a record code check (a value can be supplied with the DBADD or DBCRE macro).

SW00WKA
Start address of free space provided by the TPFDF product when the SPACE or SPACEB parameter is entered with the DBOPN or DBSPA macro or the dfopn or dfspa function.

There are also two fields that an application program can use. They are:

SW00USI
A 1-byte user indicator

SW00USA
A 4-byte user address field.

TPFDF Macros and Functions

Application programmers do not directly access the information in DBDEF tables. They can code high-level TPFDF assembler macros or C language functions in the application program to retrieve or manipulate data. These macro instructions call online TPFDF programs. The TPFDF programs use the information in the DBDEF tables to generate traditional TPF or ALCS file handling requests.

Table 1 summarizes the assembler macros and C language functions that are available with the TPFDF product. For more information about TPFDF macros and C language functions, see TPFDF Programming Concepts and Reference.

Table 1. Summary of TPFDF Macros and Functions

Macro C Function Description
DBADD dfadd Add a logical record to a file. DBADD and dfadd use designated keys to identify the location where a logical record will be inserted.
DBADR dfadr Designate a begin and end ordinal for sequential processing of the entire file.
DBCKP dfckp Write an open file in main storage to DASD.
DBCLR dfclr Allow an ECB to exit with open files.
DBCLS dfcls Complete processing and ensure that modified blocks are written to DASD.
DBCPY dfcpy Create a copy of an open file in pool files.
DBCRE dfcre Create an empty file.
DBIFB dfifb Locate the TPFDF control information for a file.
DBDIX dfdix Remove a logical record from a high-level index file for a detail file.
DBDEL dfdel Delete a logical record.
DBDSP dfdsp Produce an output message using FMSG or WTOPC.
DBFRL dffrl Verify that an entry control block (ECB) data level is not occupied by a TPFDF file.
DBIDX dfidx Create a high-level index reference for a detail file.
DBKEY dfkey Define keys.
DBMRG dfmrg Merge two input files into one output file.
DBMOD dfmod Indicate an LREC has been modified or modify LRECs that match previously established keys.
DBOPN dfopn Open a file. Initialize the file for application program use.
N/A dfopt Set options in an open subfile.
DBRED dfred Locate a logical record in a file.
DBREP dfrep Replace a logical record with a new logical record.
DBRET dfret Save a reference to the current logical record.
DBRST dfrst Restore a file from a copy to another file address.
DBSRT dfsrt Create an output file with sorted logical records.
DBSPA dfspa Allocate space for an opened file.
DBTLD dftld Write a file to a DASD location.
DBTLG dftlg Write a file to a real-time or general tape.
DBTRD dftrd Read a file from an input tape.
DBUKY dfuky Request a unique key.

TPFDF Maintenance and Test Utility (ZUDFM)

ZUDFM commands provide maintenance and test capabilities that include:

For more information about the ZUDFM utility, see TPFDF Utilities.

TPFDF Data Collection Utility (ZUDFC)

ZUDFC commands allow the database administrator or system programmer who maintains the TPFDF product to gather and display statistics relating to system usage. For more information about the ZUDFC utility, see TPFDF Utilities.

TPFDF Capture/Restore Utility, Information and Statistics Environment (ZFCRU)

ZFCRU commands provide capture and restore capabilities that include:

Note:
The ZFCRU command is not supported in an ALCS environment. For more information about the capture/restore utility, information and statistics environment (CRUISE), see TPFDF Utilities.

TPFDF Recoup Utility (ZRECP)

The TPFDF product includes a recoup utility that does recoup functions for both TPFDF and traditional databases.

Note:
TPFDF recoup runs as an extension to TPF recoup.

In the ALCS environment, you can chain chase TPFDF databases using the information contained in the DBDEF tables. To use the DBDEF table information during ALCS recoup, you must install the TPFDF sample user exit code. For more information about installing user exit code, see TPFDF Installation and Customization. For more information about the ZRECP utility, see TPFDF Utilities.