Extraction and modification of data

Universal Batch Utility (UBU) can be executed in Extract mode or in Modify mode. When operating in Extract mode, UBU reads the parameters from the SYSIN DD statement and then connects to the specified Db2® subsystem (DB2SSID). UBU extracts the specified object types from the desired table, and writes the data to a flat file named BJTDATA. This output can then be modified and used as input to UBU in modify mode. Any modifications made to the data in the BJTDATA file are loaded into the specified Db2 subsystem (DB2SSID) by UBU.

Extracting data with UBU
When operating in Extract mode (RUNMODE(EXTRACT)), UBU queries the Output Manager database and writes the results of the query to a single flat file for subsequent processing outside of Output Manager administrative dialogs.

This is conceptually similar to a SELECT … WHERE query issued with SPUFI. The key difference is that you do not need to know or understand the inter-table relationships in order to issue the query and obtain the results.

Modifying data with UBU
When operating in Modify mode (RUNMODE(MODIFY)), UBU provides the ability to add, update or delete Output Manager administrative data by specifying the requested operation (add, update, or delete), and the necessary data to be modified, in the BJTDATA input file.

This is similar to INSERT and UPDATE … WHERE processing entered with SPUFI. The key difference is that you do not need to know or understand the inter-table relationships needed to accomplish the processing.

The SYSIN DD is mandatory; the sections included in the SYSIN DD determine whether UBU operates in Extract or Modify mode. If you include the optional input section SELECT, UBU will execute in Extract mode. If the SELECT input section is omitted, UBU will execute in Modify mode. In addition, the SYSIN DD controls contain parameters for execution. For descriptions of these sections and parameters, see Overview of the parameters used to control UBU execution (SYSIN).

BJTDATA is the flat file output of UBU Extract, and the flat file input of UBU Modify. The data in the output file BJTDATA can be changed with a custom-developed program or a text editor, and used as input for UBU Modify. BJTDATA consists of several columns: the UBU header columns (H_ACT_REQ, H_DD_DEF, H_ROWID), and columns containing the extracted administrative data. When using UBU to modify the Output Manager database, specify the action to perform on the data (ADD, UPDATE, or DELETE), in the H_ACT_REQ column of the BJTDATA file, and specify the new value in the appropriate columns to be modified.
Note: When performing UPDATE and DELETE operations, do not modify the data in the H_ROWID, for this data is used to identify the data in the tables.

Figure 1 summarizes the overall architecture of the utility.

Figure 1. Overall architecture of the Universal Batch Utility
overview of Universal Batch Utility architecture