Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Date convesrion from cyymmdd to datfmt(*USA) NOT working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date convesrion from cyymmdd to datfmt(*USA) NOT working

    What is the result value in WSTRDAT? Dave

  • #2
    Date convesrion from cyymmdd to datfmt(*USA) NOT working

    It's been my experience that when a 7 byte field is used to store a date the first byte indicated what century you are dealing with. You will need to review the data in the field to determine what format the date is in. The attached code might help.
    Code

    Comment


    • #3
      Date convesrion from cyymmdd to datfmt(*USA) NOT working

      Thanks for your help.

      Comment


      • #4
        Date convesrion from cyymmdd to datfmt(*USA) NOT working

        I think you need to check the CVTOPT keyword on the CRTCBLMOD or CRTBNDCBL commands. The relevant default values are *NODATETIME and *NODATE. If you specify CVTOPT(*DATETIME *DATE) date fields from the database will retain their names and be brought in as date data types. The help text for CVTOPT from the CRTBNDCBL command is shown below:[*]NODATETIME (This is a default) Date, time, and timestamp data types are declared as FILLER fields.[*]DATETIME Date, time, and timestamp DDS data types are given COBOL data item names based on their DDS names. The category of the COBOL data item is alphanumeric, unless one of the CVTOPT parameter values *DATE, *TIME, or *TIMESTAMP is specified. In this case, the category of the COBOL data item is date, time, or timestamp, respectively.[*]NODATE (This is a default) DDS date data types are declared as category alphanumeric COBOL data items, for example: 06 FILLER PIC X(10). The COBOL data item name is determined by the *NODATETIME/*DATETIME CVTOPT parameter.[*]DATE DDS date data types are declared as category date COBOL data items, for example: 06 FILLER FORMAT DATE '@Y-%m-%d'.

        Comment


        • #5
          Date convesrion from cyymmdd to datfmt(*USA) NOT working

          Date convesrion from cyymmdd to datfmt(*USA) NOT working. Anybody has good solution ? Format-Dates. Move Function Convert-Date-Time (STRDAT DATE '@C%y%m%d') to WSTRDAT of PDTLINE-O. Here STRDAT is 06 STRDAT PIC S9(7) COMP-3. A WSTRDAT L 52DATFMT(*USA) TEXT('Start Date') becomes 06 WSTRDAT PIC X(10). Start Date (Date field)

          Comment

          Working...
          X