DDS L Date with no DatFmt keyword

45 pts.
Tags:
AS/400
Physical File
The question we have is that we have a DDS defined Physical file and the source is defining a date field with L but no datfmt keyword. Our sysval is DMY. Will this field be seen as *iso or DMY by the database? The only info we can see from IBM is that it will be defaulted to ISO is this correct? Thanks in advance!
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • azohawk
    A field defined with as an L type is by default an *ISO field on the system. To my knowledge, there is no way to change that. This also includes default formating of the data. The default value added to the field, if no specific value is entered, is 0001-01-01.
    4,055 pointsBadges:
    report
  • ToddN2000
    On our system the "L" type, defined with a length of 10 shows YYYY-MM-DD when displayed using DSPPFM. There is another code for dealing with dates, "Z" , with a length of 26. This is a timestamp type field with YYYY-MM-DD-HH.MM.SS.mmmmmm.
    Hope that helps.

    134,845 pointsBadges:
    report
  • philpl1jb

    All dates are stored in the database as ISO.

    The default format would effect some ways of displaying the data such as Query/400.

    54,090 pointsBadges:
    report
  • TheRealRaven
    The DDS for a physical file is intended to describe the interface to and from DB2. Without DATFMT(), DB2 will expect to receive values through its interfaces in *ISO format. It will also return values in *ISO format.

    If you have the QDATFMT system value set as DMY, then the basic presentation interfaces will expect values in DMY format and will present dates in *DMY format. The primary interface for presentation will be display files, and printer files are almost as common for many sites.

    Will this field be seen as *iso or DMY by the database ?

    The "database" will see it as *ISO. It can be seen simply by running a RUNQRY command for the file or by using DSPPFM as ToddN2000 mentions.

    If you specify DATFMT(*DMY) in the DDS, then DB2 will see it (and store and retrieve it) in DMY format.

    You can create a copy of the DDS and change the copy to include DATFMT(*DMY). Compile the DDS as a different file name, then use CPYF to copy records from the first file to the new one to see the difference.

    The first thing you should notice is that the CPYF command will require the FMTOPT(*MAP) parameter. The date field must formatted by the command to map to the changed definition.

    But RUNQRY over the two versions of the file will show that *ISO is used by DB2 in the first file and *DMY is used for the second file.

    In both cases, the actual format that is used in the data space on disk is neither *ISO nor *DMY. It's a special format that you'll probably never actually see. DB2 simply uses the DATFMT attribute to decide how the data in a record buffer should look when it passes a record to you and when it receives a record from you. It's up to you to ensure that the date value is in the assigned format.

    The format assignment is necessary for DB2 to be able to determine if a date value is valid or not.
    36,095 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: