IBM i Global

 View Only
  • 1.  Does environment variable QIBM_QBASEYEAR affect timestamp variables?

    IBM Champion
    Posted Wed April 05, 2023 08:10 AM

    Environment:  IBM i 7.5, TR 1, cume 22321, Hiper 22, db 3.

    While looking at a different thread in which a gentleman tried to use all inclusive timestamps to get beginning to end I noticed something odd.
    He was using a sql service with parameters like
    starting_timestamp => '0001-01-01-00.00.00.000000',
    ending_timestamp => '9999-12-31-23.59.59.999999'
    and it wasn't finding anything.
    I suggested he just follow the doc for that function, leave those blank and it would work.  However I did delve into this further.
    The starting timestamp was fine.
    It was the ending timestamp.
    If I used '3069-12-31-23.59.59.999999' it worked fine.
    If I used '3070-12-31-23.59.59.999999' I would get 
    SQL State: 42616, Vendor Code: -443, Message: [SQL0443] ENDING_TIMESTAMP IS EARLIER THAN STARTING TIMESTAMP
    https://www.ibm.com/support/pages/node/6579221?mhsrc=ibmsearch_a&mhq=QIBM%26lowbar%3BQBASEYEAR
    Will someone on an older OS which still supports this function try 2039 then try 2040?
    select *
        from table (qsys2.display_journal ('QSYS',
             'QAUDJRN',
             starting_receiver_name => 'Q633900051',
             starting_receiver_library => 'QSYS',
             ending_receiver_name => 'Q633900051',
             ending_receiver_library => 'QSYS',
             starting_timestamp => '0001-01-01-00.00.00.000000',
             ending_timestamp => '3070-12-31-23.59.59.999999'
             )) ;



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------


  • 2.  RE: Does environment variable QIBM_QBASEYEAR affect timestamp variables?

    IBM Champion
    Posted Wed April 05, 2023 10:25 AM

    I've opened case TS012653923 for IBM i 7.5. IBM just replied that they are able to duplicate it and will pursue further.

    It does surprise me that earlier releases have changed to the later sliding date.

    Apparently all releases have and the environment variable is simply there on 7.5 in case you want to revert to the old sliding date.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 3.  RE: Does environment variable QIBM_QBASEYEAR affect timestamp variables?

    IBM Champion
    Posted Wed April 05, 2023 12:31 PM

    BTW, neither lpar I was testing with have QIBM_QBASEYEAR as either a system or job environment variable.

    SELECT * FROM QSYS2.ENVIRONMENT_VARIABLE_INFO;
    shows both job and system and QIBM_QBASEYEAR is in neither.


    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 4.  RE: Does environment variable QIBM_QBASEYEAR affect timestamp variables?

    IBM Champion
    Posted Thu April 06, 2023 07:28 AM

    Definitive answer from IBM as posted in my case:

    "IBM development answered that system date functions only extend to the system date range of 2069.

    Since the DISPLAY_JOURNAL function uses the QjoRetrieveJournalEntries API, and that API uses system date functions, the developer says that any date past 2069 would be unreliable. "



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------