Compute Timestamp Duration (CTSD)

Instruction Syntax

Op Code (Hex) Operand 1 Operand 2 Operand 3 Operand 4
043C Timestamp duration Timestamp 1 Timestamp 2 Instruction template
Operand 1: Packed decimal variable scalar.

Operand 2: Character scalar.

Operand 3: Character scalar.

Operand 4: Space pointer.

Bound Program Access
Built-in number for CTSD is 103.
CTSD (
      timestamp_duration     : address of packed decimal
      timestamp1             : address
      timestamp2             : address
      instruction_template   : address
)

Description:

The timestamp specified by operand 3 is subtracted from the timestamp specified by operand 2 and the resulting time duration is placed in operand 1. Operand 4 defines the data definitional attributes for operands 1 through 3.

A negative value will be returned when the timestamp 1 operand is less than the timestamp 2 operand.

The following describes the instruction template.

Offset  
Dec Hex Field Name Data Type and Length
0 0 Instruction template Char(*)
0 0
  • Instruction template size
  • Bin(4)
4 4
  • Operand 1 data definitional attribute template number
  • UBin(2)
6 6
  • Operand 2 data definitional attribute template number
  • UBin(2)
8 8
  • Operand 3 data definitional attribute template number
  • UBin(2)
Start of change10End of change Start of changeAEnd of change Start of change
  • Operand 1 length
End of change
Start of change
  • UBin(2)
End of change
Start of change10End of change Start of changeAEnd of change Start of change
    • Fractional number of digits
End of change
Start of change
    • UBin(1)
End of change
Start of change11End of change Start of changeBEnd of change Start of change
    • Total number of digits
End of change
Start of change
    • UBin(1)
End of change
12 C
  • Operand 2 length
  • UBin(2)
14 E
  • Operand 3 length
  • UBin(2)
Start of change16End of change Start of change10End of change Start of change
  • Operand 2 precision
End of change
Start of change
  • UBin(1)
End of change
Start of change17End of change Start of change11End of change Start of change
  • Operand 3 precision
End of change
Start of change
  • UBin(1)
End of change
Start of change18End of change Start of change12End of change Start of change
  • Reserved (binary 0)
End of change
Start of change
  • Char(24)
End of change
42 2A
  • Data definitional attribute template list
  • Char(*)
42 2A
    • Size of the DDAT list
    • UBin(4)
46 2E
    • Number of DDATs
    • UBin(2)
48 30
    • Reserved (binary 0)
    • Char(10)
58 3A
    • DDAT offset
    • [*] UBin(4)
* *
    • Data definitional attribute template
    • [*] Char(*)

*

*

--- End ---

 

A data definitional attribute template (DDAT) number is a number that corresponds to the relative position of a template in the data definitional attribute template list. For example, the number 1 references the first template. The valid values for this field are 1, 2, and 3.

The DDAT for operand 1 must be valid for a timestamp duration. The DDATs for operands 2 and 3 must be valid for a timestamp and must be identical. Otherwise, a template value invalid (hex 3801) exception will be signaled.

Start of changeOperand 1 length is specified in number of digits.End of change Operand 2 length and operand 3 length are specified in number of bytes.

Start of changeFractional number of digits indicates the fractional second precision, and is only valid for timestamp duration. A template value invalid (hex 3801) exception is signaled if a non-zero precision is specified for any other duration. Valid values for fractional number of digits are binary 0 through binary 12 inclusive, with corresponding valid values for total number of digits of binary 14 through binary 26 inclusive. In other words, when specified the fractional number of digits must equal the total number of digits minus binary 14. Any other values result in a template value invalid (hex 3801) exception. An operand 1 length of 0 will result in the default of 20 total number of digits and 6 fractional number of digits.End of change

Start of changeOperand 2 precision and operand 3 precision indicate a fractional second precision. Valid values are hex FF and binary 0 to binary 12 inclusive. Any other values result in a template value invalid (hex 3801) exception. A value of hex FF will result in 0 fractional precision digits. Values of binary 1 through binary 12 will result in 1 through 12 fractional precision digits. A value of 0 will result in 6 fractional precision digits. The operation is performed using the maximum precision of operands 2 and 3, with the result placed in operand 1 with precision defined by the fractional number of digits. If the result precision is greater than the precision of the computed duration, then the result duration is padded with zero digits. If the result precision is less than the precision of the computed duration, then the result duration is truncated. End of change

The size of the DDAT list is specified in bytes.

The number of DDATs is the count of DDATs specified for this instruction template. The maximum number of DDATs that can be specified is 3.

The DDAT offset is the number of bytes from the start of the DDAT list to the start of the specific DDAT. There should be as many DDAT offsets as there are DDATs specified.

A data definitional attribute template defines the presentation of the data. Each template describes the definitional attributes of the operands. The length of the character operands will be defined by the template. For a further description of the data definitional attribute template, see Data Definitional Attribute Template.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 0C Computation
    • 0C15 Date Boundary Overflow
    • 0C16 Data Format Error
    • 0C17 Data Value Error
    • 0C18 Date Boundary Underflow
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 32 Scalar Specification
    • 3202 Scalar Attributes Invalid
    • 3203 Scalar Value Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 38 Template Specification
    • 3801 Template Value Invalid
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed