EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Timestamp format issue between DB2 and RBD

    Posted Sat January 10, 2015 09:53 AM

     

    One RBD V9.1.1 customer experienced  the EGL timestamp format error when inserting SQL record with timestamp value.

    , which runs fine in VAGen.   Customer used char(26) to store timestamp value because VAGen didn't support timestamp type. 

    When running the  attached EGL testcase,  returned values are :  

    EGLTimeStamp (char(26) is :   2015-01-10 22:14:45.987   
    TS TimeStamp type is :            2015-01-10 22:14:42

     

    If  you run " select current timestamp from sysibm.sysdummy1"  in DB2CMD, you get 

    2015-01-10-22.44.21.222000

    Please advise or share your experience on solving  the problem ,  thanks !  

    program testcase type BasicProgram() {}    EGLTimeStamp char(26);        TS timeStamp {timestampformat=db2TimestampFormat};                function main()                sysdummy1 sysdummy1;                                get sysdummy1 with                        #sql{                                select                                        current Timestamp                                                                                               from sysibm.sysdummy1 L1                        }                        into  EGLTimeStamp                              ;                                                 syslib.writeStdout("EGLTimeStamp (char(26) is :   "  +    EGLTimeStamp);                        syslib.writeStdout("TS TimeStamp type is :   "  +    TS);        end        end// SQL record with table names//record sysdummy1 type SQLRecord          {tableNames = [["sysibm.sysdummy1", "L1"]], fieldsMatchColumns = yes}                IBMREQD string          {column="IBMREQD", maxLen=1};         end

     

     

    dwkey


  • 2.  Re: Timestamp format issue between DB2 and RBD

    Posted Sat January 10, 2015 09:50 PM

    I assume this is a cobolGen question. Could you please open a PMR and send the generated cobol source code for the example you created, from both VAG and EGL?

    Thank you. I will have a look when I receive those files.

    Jeff.Douglas


  • 3.  Re: Timestamp format issue between DB2 and RBD

    Posted Sun January 11, 2015 12:14 AM

    Jeff,

    Thanks for reply. 

     

    Customer's server platform is Windows,  I will provide both VAGen C++ and RBD/Java source with PMR.    

     

    dwkey


  • 4.  Re: Timestamp format issue between DB2 and RBD

    Posted Mon January 12, 2015 08:39 AM

    L.H.,

    I may have missed it, but what is the expected value you are wanting to get back from DB2?   In other words, what value did they get from DB2 in VAGen.

    Are they concerned about the decimal values or the separators? 

    And what JDBC properties are you using on the connection URL.  This is what normally controls the format when you use CHAR host variables with a DB2 timeStamp column type, not EGL. 

    Finally, couple of questions:

    - you said they had a problem with insert, but your example shows the "get".   What is the format in the CHAR host variable when it is inserted?

    - How is the record defined?   And especially the field in the record ?  Does it have a sqlDataCode specified?

    - What build descriptor settings are being used when the program is run?

    - If this is a runtime problem, what java runtime properties are set (usually controlled by build descriptors, but not 100%)

    As Jeff said, you can open a PMR, but you can also post the answers/sample code here.  I believe this is just a matter of setup and the answer would be good for all...but we can see.

    Mark

    markevans


  • 5.  Re: Timestamp format issue between DB2 and RBD

    Posted Mon January 19, 2015 12:38 AM

    Mark,

    Customer's reply  is below.  

    The Timestamp value from VAGen/DB2 is   :    YYYY-MM-DD-hh.mm.ss ( Same format as DB2 ) 

    Customer expects  RBD/DB2  can get the same Timestamp value  as VAGen provided to have the problem solved. 

    Customer is not concerned about the decimal value or separators,  It's server runs on both Windows and system with different results after migrating to RBD.

    THe SQL record is below.   No sqlDataCode  is specified ‹

    Record FRTOROPW type sqlRecord  {  tableNames = [["DB2ADMIN.FRTOROPW", "T1"]]  }  3 BRANCH char(4) { column = "BRANCH", isSQLNullable = yes} ;  3 ACC_CODE char(10) { column = "ACC_CODE", isSQLNullable = yes} ;  3 UNIT_CODE char(1) { column = "UNIT_CODE", isSQLNullable = yes} ;  3 TX_DATE char(8) { column = "TX_DATE", isSQLNullable = yes} ;  3 REF_NO char(16) { column = "REF_NO", isSQLNullable = yes} ;  3 DR_CR char(2) { column = "DR_CR", isSQLNullable = yes} ;  3 CUST_ID char(6) { column = "CUST_ID", isSQLNullable = yes} ;  3 CUST_NAME char(35) { column = "CUST_NAME", isSQLNullable = yes} ;  3 CCY char(3) { column = "CCY", isSQLNullable = yes} ;  3 AMT decimal(15,2) { column = "AMT", isSQLNullable = yes} ;  3 SET_AMT decimal(15,2) { column = "SET_AMT", isSQLNullable = yes} ;  3 UPD_TIME char(26) { column = "UPD_TIME", isSQLNullable = yes} ;end // end FRTOROPW

     

    dwkey


  • 6.  Re: Timestamp format issue between DB2 and RBD

    Posted Mon January 19, 2015 01:25 AM

    Mark,

    Customer just informed me that the RBD  program migrated from VAGen without change  is running fine in Windows to access DB2 Windows.  

    It means the behavior is same regarding the timestamp  in both VAGen/C++   and EGL/Java  runtime environment. 

    I will close the subject , thanks !   

    dwkey