Convert Date (CVTD)

Instruction Syntax

Op Code (Hex) Operand 1 Operand 2 Operand 3
040F Result date Source date/timestamp Instruction template
Operand 1: Character variable scalar, packed variable scalar, or zoned variable scalar.

Operand 2: Character scalar, packed scalar, or zoned scalar.

Operand 3: Space pointer.

Bound Program Access
Built-in number for CVTD is 104.
CVTD (
      result_date            : address of  aggregate OR
                               address of  zoned decimal OR
                               address of  packed decimal
      source_date/timestamp  : address of  aggregate OR
                               address of  zoned decimal OR
                               address of  packed decimal
      instruction_template   : address
)

Description:

The date specified in operand 2 is converted to another calendar external or internal presentation and placed in operand 1. If operand 2 is a timestamp the date is extracted, converted to another calendar external or internal presentation and placed in operand 1. The timestamp fractional seconds are ignored. Operand 3 defines the data definitional attributes for operands 1 and 2.

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
  • Reserved (binary 0)
  • Char(2)
10 A
  • Operand 1 length
  • UBin(2)
12 C
  • Operand 2 length
  • UBin(2)
14 E
  • Reserved (binary 0)
  • Char(2)
16 10
  • Preferred/Found date/timestamp format
  • UBin(2)
18 12
  • Preferred/Found date separator
  • Char(1)
19 13
  • Preferred/Found time separator
  • Char(1)
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 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 and 2.

The DDAT for operand 1 must be valid for a date. Otherwise, a template value invalid (hex 3801) exception will be signaled. The DDAT for operand 2 must be valid for a date or timestamp. Otherwise, a template value invalid (hex 3801) exception will be signaled.

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

If the data definitional attribute template numbers for operands 1 and 2 are the same, only data validation is performed. The validation will check for format and data value correctness.

A format of unknown date, time, or timestamp will indicate that operand 2 will be scanned for a valid format. For a list of formats that can be scanned, see Data Definitional Attribute Template. With an unknown format, the preferred/found date/timestamp format , preferred/found date separator , and preferred/found time separator can be specified to select an additional non-scanable format. The preferred format and preferred separators will be used first to find a matching format before scanning operand 2. The preferred time separator is ignored when the preferred format is a date. When the preferred format and preferred separators have a hex value of zero, only the scan occurs.

When a format of unknown date, time, or timestamp is specified, the preferred/found date/timestamp format , preferred/found date separator , and preferred/found time separator fields will be set to the format and separators found. If the format found is a date the preferred/found time separator will be set to a hex value of zero.

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 2.

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 templates. 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