Datum
In the mainframe context, a **datum** refers to a single, atomic piece of information or a single data point. It is the smallest unit of data that can be individually identified, stored, and processed within a larger data structure like a record, file, or database. A datum is a single, atomic piece of information or data value, often representing a specific attribute or measurement within a larger dataset or record. In the mainframe and z/OS context, a datum is typically a value stored in a field, processed by a program (e.g., COBOL), or retrieved from a database (e.g., DB2, IMS).
Key Characteristics
-
- Atomic: A datum is considered indivisible; it represents the smallest meaningful unit of information that cannot be broken down further without losing its meaning.
- Typed: Each datum has an associated data type (e.g., character, numeric, packed decimal, binary) that dictates its format, storage requirements, and valid operations in languages like COBOL or PL/I.
- Contextual: Its meaning is derived from its position within a record, its association with a field name, or its column definition in a database schema (e.g.,
CUSTOMER-NAMEvs.CUSTOMER-ID). - Stored: Datums are physically stored in memory, on direct access storage devices (DASD), or tape, typically as part of larger data aggregates like records or blocks.
- Manipulated by Programs: Mainframe programming languages like COBOL, PL/I, and Assembler directly access, read, write, and manipulate individual datums based on their defined attributes.
Use Cases
-
- COBOL Field: A specific
PICclause within a01level record definition, such asCUSTOMER-NAME PIC X(30)orORDER-QUANTITY PIC 9(5) COMP-3. - DB2 Column Value: A single value in a specific column for a given row in a DB2 table, e.g., the
EMP_ID(integer) for an employee record orLAST_NAME(VARCHAR). - IMS Segment Field: A specific field within an IMS segment, representing a particular attribute of the entity described by the segment, like a
PART-NUMBERin aPARTsegment. - JCL Parameter: A single value passed as a parameter to a program via
PARM=in anEXECstatement, such asPARM='DEBUG'orPARM='001'. - System Log Entry: A timestamp, an event code, a user ID, or a resource name recorded as a distinct piece of information in a system log or SMF record.
- COBOL Field: A specific
Related Concepts
A datum is the fundamental building block of all data structures on the mainframe. Multiple datums are grouped together to form fields, which in turn constitute records (in COBOL) or rows (in DB2). These records are then organized into datasets (files) or database tables (DB2) or segments (IMS). Programs written in COBOL, PL/I, or Assembler operate on these datums, performing calculations, comparisons, and transformations. JCL defines how datasets containing these datums are allocated and accessed, and DD statements might specify record formats (RECFM) that implicitly define how datums are structured within records.
- Precise Definition: Always define the data type, length, and format of each datum precisely within program code (e.g.,
PICclauses in COBOL) and database schemas to ensure data integrity and prevent data truncation or corruption. - Data Validation: Implement robust validation routines to ensure that each datum conforms to its expected type, range, and format before processing or storage, especially for user input or external data.
- Appropriate Storage: Choose the most efficient storage format (e.g.,
COMP-3for packed decimal,BINARYfor integers) for numeric datums to optimize storage space and improve processing speed on the mainframe. - Clear Documentation: Document the purpose, meaning, and allowed values for each datum, especially when it is part of a shared record layout or database schema, to aid maintainability and understanding across development teams.
- EBCDIC vs. ASCII Awareness: Be mindful of the character encoding (primarily EBCDIC on z/OS) when exchanging