Derived
In the mainframe context, **derived data** refers to data values that are not directly stored but are computed or calculated from one or more existing base data elements. This calculation can occur dynamically at the time of access or be pre-computed and stored, often to represent business metrics, aggregated information, or calculated fields within applications. In the mainframe context, "derived" refers to data or values that are not directly stored but are calculated, computed, or logically inferred from existing, stored data. This process transforms raw data into more meaningful or aggregated information, often reflecting a current state based on its source components.
Key Characteristics
-
- Computation-Based: Values are generated through arithmetic operations, logical expressions, or algorithmic processes applied to existing base data fields.
- Non-Persistent (Often): Derived data is frequently calculated on-the-fly, meaning it doesn't occupy dedicated storage space in the primary data records, though it can be materialized into temporary or persistent storage.
- Data Redundancy Reduction: By deriving values, you can avoid storing redundant calculated fields, reducing storage requirements and the potential for data inconsistency if base data changes.
- Business Logic Encapsulation: The rules for deriving data often embed critical business logic, ensuring consistent application of calculations across different programs or queries.
- Performance Implications: On-the-fly derivation can impact query or application performance, especially for complex calculations or large datasets, necessitating careful design and optimization.
- Data Integrity: The integrity and accuracy of derived data are directly dependent on the integrity and accuracy of the underlying base data from which it is calculated.
Use Cases
-
- DB2 Views: Creating a
VIEWinDB2where one or more columns are defined by an SQL expression (e.g.,SALARY * 1.05 AS ADJUSTED_SALARY) that calculates a value from base table columns. - COBOL Application Logic: A
COBOLprogram reading transaction records and calculatingNET-PAYfromGROSS-PAYminusTAXandDEDUCTIONSbefore displaying or writing the result to a report or file. - Reporting and Analytics: Generating summary reports where fields like
TOTAL-SALES,AVERAGE-PRICE, orCOUNT-OF-ORDERSare derived by aggregating base transaction data using tools likeSASor customJCLjobs. - IMS Database Application Processing: While
IMSdoesn't have native derived fields like DB2 views,IMS/DBapplications often derive values from existing segment fields during processing (e.g., calculating anAGEfrom aDATE-OF-BIRTHfield). - Data Warehousing on z/OS: In a mainframe data warehouse, creating aggregate tables where metrics like
MONTHLY_SALES_TOTALare derived from detailed daily sales transactions to support business intelligence.
- DB2 Views: Creating a
Related Concepts
Derived data is closely related to VIEWS in DB2, which provide a virtual table whose content is defined by a query, often including derived columns. It contrasts with base data, which is directly stored and represents the fundamental facts. In COBOL applications, the concept is fundamental to most business logic involving calculations and data transformation. It also plays a crucial role in reporting tools and data warehousing on the mainframe, where complex aggregations and transformations are common to produce meaningful business insights from raw operational data.
- Optimize Calculation Logic: For frequently accessed derived data, ensure the calculation logic is efficient. In
DB2, this might involve appropriate indexing on base columns or optimizing SQL expressions. - **Document Derivation Rules