Compute Date Duration (CDD)


Op Code (Hex) Operand 1 Operand 2 Operand 3 Operand 4
0424 Date duration Date 1 Date 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 CDD is 101. CDD ( date_duration : address of packed decimal date1 : address date2 : address instruction_template : address )

Description

The date specified by operand 3 is subtracted from the date specified by operand 2 and the resulting date 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 date 1 operand is less than the date 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
UBin(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)
10 A
Reserved (binary 0)
Char(2)
12 C
Operand 2 length
UBin(2)
14 E
Operand 3 length
UBin(2)
16 10
Reserved (binary 0)
Char(26)
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 date duration. The DDATs for operands 2 and 3 must be valid for a date and must be identical. Otherwise, a template value invalid  (hex 3801) exception will be signaled.

Operand 2 length and operand 3 length are specified in number of bytes.

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

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0C Computation

10 Damage Encountered

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

32 Scalar Specification

36 Space Management

38 Template Specification

44 Protection Violation