ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

date type in physical file

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

  • date type in physical file

    Hello,
    my questions is abt date type in a physical file
    if i want a field to be a date type...how can i specify the format of the date

    thanks in advance

  • #2
    Re: date type in physical file

    Hi



    Code:
    A            DATEFIELD       L         DATFMT(*EUR)
    Last edited by Zdenko; June 7, 2007, 02:18 AM.
    LP Zdenko

    Comment


    • #3
      Re: date type in physical file

      thanks...
      but other than EUR wut choices are available???

      Comment


      • #4
        Re: date type in physical file

        Hi

        LP Zdenko

        Comment


        • #5
          Re: date type in physical file

          Actually .. you don't have to specify. If it's a date type, you can store it as a default (Usually *ISO) but, can retrieve the date in any format you want (*USA, *EUR, *ISO, etc...)

          -R

          Comment


          • #6
            Re: date type in physical file

            IMHO the date format should not be specified in a physical file.

            A date is always stored in a 4-Byte binary value representing the calculated number of days since 01/01/0001.

            Date formats are only necessary to make this binary value readeable. If no date format is specified in the physical file the binrary value is shown as *ISO format. (YYYY-MM-DD)

            In RPG and all SQL interfaces there are options to determine the date format you want to use.

            Birgitta

            Comment


            • #7
              Re: date type in physical file

              For the COBOLers out there, don't forget to use the CVTOPT(*DATETIME *DATE *TIME *TIMESTAMP) compile options when using date and timestamp datatypes in a PF or LF. If not, the COPY DDS will give you funky results.
              iSeriesCOBOL
              www.iseries-cobol.com

              Comment


              • #8
                Re: date type in physical file

                It's the same when compiling rpg4 (non-le) *datetime option on the compile command.
                Bill
                "A good friend will bail you out of jail,
                A true friend would be sitting beside you saying,
                'Wow, that was fun.'"

                Comment

                Working...
                X