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.  get sql usa date format

    Posted Mon September 23, 2019 11:38 PM

    When doing a "get", i would like the date format to default to USA. Is there a way to do this universally?

     

    nick_tn


  • 2.  Re: get sql usa date format

    Posted Tue September 24, 2019 02:00 AM

    Hi Nick,

    you can set the default date and time format like this:

            strlib.defaultDateFormat = "dd.MM.yyyy";
            strlib.defaultTimeFormat = "HH:mm:ss";

     

    Marcel-D


  • 3.  Re: get sql usa date format

    Posted Tue September 24, 2019 09:02 AM

    Hey Marcel,

    That didnt work. Here is my code

    try                if(userin[1 : 1] == "@")                userin = userin[2 : strlib.characterLen(clip(userin))];            end            strlib.defaultDateFormat = " dd.MM.yyyy";             getplace_historyrec getplace_historyrec[0];                        get getplace_historyrec with                                #sql{                                        SELECT clpdt||' ('||count(*)||')' as data                                                              FROM qs36f.claims                                         WHERE cno in ( SELECT CWDDIV FROM ntfiles.cwuserdiv WHERE CWDUSER =:userin)                                         and clpdt > current date - 4 months                                         GROUP BY clpdt                                         ORDER BY clpdt desc                                                                                };            return(getplace_historyrec);        onException(exception AnyException)            genericmessage("getcashcheck", " ", userin, exception);        end

     

    nick_tn


  • 4.  Re: get sql usa date format

    Posted Tue September 24, 2019 08:16 AM

    Hi Nick,

    I saw you are used jt400 connector then you could setup jt400 properties as default 

    date format=USA

    or set connection URL to

    jdbc:as400:host;prompt=false;date format=USA

    Regards,

    Hsieh

    Hsieh


  • 5.  Re: get sql usa date format

    Posted Tue September 24, 2019 09:04 AM

    Hey Hsieh,

    I have done this in the past when i was using a stand alone Tomcat server. Just changed that setting in my build descriptor.

    Now i am using (or trying to) Apache via IBM Web Administration for i. Im actually dont know where to make those changes. If you have any incite, please share.

    Nick

    nick_tn


  • 6.  Re: get sql usa date format

    Posted Tue September 24, 2019 09:31 AM

    I'm so sorry but i don't have IBM Web Administration for i.  

    Try find where is the JDBC config.

    https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rzaha/conprop.htm

     

    Hsieh


  • 7.  Re: get sql usa date format

    Posted Tue September 24, 2019 09:52 AM

    i think its part of the server.xml file. Im reviewing the following under the db2 on iseries (toolbox). Im sure somewhere in the "properties" element, i can specify those settings.

    https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_dep_configuring_ds.html

    nick_tn


  • 8.  Re: get sql usa date format

    Posted Tue September 24, 2019 12:35 PM

    Nick,

    You are close to solving your question.  :-)

    Find the data source configuration to DB2 iSeries

    https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_dep_configuring_ds.html

    https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.liberty.autogen.nd.doc/ae/rwlp_config_dataSource.html

    For DB2 on iSeries (Native)

    <dataSource id="DefaultDataSource" jndiName="jdbc/db2iNative">    <jdbcDriver libraryRef="DB2iNativeLib"/>    <properties.db2.i.native databaseName="*LOCAL" dateFormat="USA"/></dataSource><library id="DB2iNativeLib">    <fileset dir="/QIBM/Proddata/OS400/Java400/ext" includes="db2_classesxx.jar"/></library>
    Hsieh


  • 9.  Re: get sql usa date format

    Posted Tue September 24, 2019 12:52 PM

    Yes, i was able to find documentation and add it. Things are working perfect now.

    Thanks for all the help!!!

    nick_tn