Decrement Date (DECD)

Instruction Syntax

Op Code (Hex) Operand 1 Operand 2 Operand 3 Operand 4
0414 Result date Source date Duration Instruction template
Operand 1: Character variable scalar.

Operand 2: Character scalar.

Operand 3: Packed decimal scalar.

Operand 4: Space pointer.

Bound Program Access
Built-in number for DECD is 96.
DECD (
      result_date            : address
      source_date            : address
      duration               : address of packed decimal
      instruction_template   : address
)

Description:

The date specified by operand 2 is decremented by the date duration specified by operand 3. The resulting date is placed in operand 1. Operand 4 defines the data definitional attributes for operands 1 through 3.

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)
10 A
  • Operand 1 length
  • UBin(2)
12 C
  • Operand 2 length
  • UBin(2)
14 E
  • Operand 3 length
  • UBin(2)
14 E
    • Fractional number of digits
    • Char(1)
15 F
    • Total number of digits
    • Char(1)
16 10
  • Input indicators
  • Char(2)

16

10

    • End of month adjustment

      0 =
      No adjustment
      1 =
      Adjustment

    • Bit 0

16

10

    • Tolerate data decimal errors

      0 =
      No toleration
      1 =
      Tolerate

    • Bit 1

16 10
    • Reserved (binary 0)
    • Bits 2-15
18 12
  • Output indicators
  • Char(2)

18

12

    • End of month adjustment

      0 =
      No adjustment
      1 =
      Adjustment

    • Bit 0

18 12
    • Reserved (binary 0)
    • Bits 1-15
20 14
  • Reserved (binary 0)
  • Char(22)
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 DDATs for operands 1 and 2 must be valid for a date and must be identical. The DDAT for operand 3 must be valid for a date duration. Otherwise, a template value invalid (hex 3801) exception will be issued.

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

The input indicator, end of month adjustment, is used to allow or disallow the occurrence of an end of month adjustment.

The input indicator, tolerate decimal data errors, is used to determine whether errors found in the packed data for the duration will generate exceptions or will be ignored. When the errors are to be tolerated, the following rules will apply:

  1. An invalid sign nibble found in the packed data value will be changed to a hex F.
  2. Any invalid decimal digits found in the packed data value will be forced to zero.
  3. If all digits of a packed data value become zero, and no decimal overflow condition exists, the sign will be set to hex F. If all digits are zero and a decimal overflow condition exists, then the sign will not be changed, but its representation will be changed to the preferred sign code.

The output indicator, end of month adjustment, is used to indicate an end of month adjustment, when end of month adjustments are allowed.

End of month adjustment is the following concept. For SAA, the result of subtracting a 1 month duration from the Gregorian date 03/31/1989 is 02/28/1989. The days portion is adjusted to fit the month, 31 is changed to 28. When this happens, the end of month adjustment output indicator is set to adjustment.

When end of month adjustments are not allowed, the month and year definitions in the data definition attribute template must have values greater than zero, otherwise a template value invalid (hex 3801) exception will be signalled. The result of subtracting a 1 month duration from the Gregorian date 03/31/1989 is 03/01/1989, when the definition of a month is 30 days.

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 definitional attributes of the operands. The length of the date and date duration 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
    • 0C02 Decimal Data
    • 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