Author Topic: New Date Format CMOD 10.5  (Read 62 times)


  • Jr. Member
  • **
  • Posts: 15
    • View Profile
New Date Format CMOD 10.5
« on: January 19, 2023, 09:43:05 AM »
I have now a mix with the ols and new Date In the cmod Tables ( Segments ) and I don't get the right output out of my Script.

If I do something like this

   while read line
   # SELECT 'table_1' AS table_name, COUNT(*) FROM table_1 UNION
      cat ${SQLHEAD} >${SQLCMDFIL}
      echo -e "spool ${SQLOUT}"  >> ${SQLCMDFIL}
      echo -e "select '#',Form,'#',Date,'#',LB1,'#',LB2,'#',LB3,'#' from "${SQLDB}"."${line}" where code = 99 ;" >>${SQLCMDFIL}
      echo -e "spool off"  >>${SQLCMDFIL}
      echo -e "exit;" >>${SQLCMDFIL}
      sqlplus -s ${Psqluser}/${Psqluserpwd} @${SQLCMDFIL}
      cat ${SQLOUT}.lst >> ${var2}/${AGI}_${AGIA}_report
   done < ${var1}/table.txt
   Then I have this Output in my File
   # FORM1 #                                                                     
       30-JUN-00 12.00.00 AM                                                       #   
         8576 # 777 #   00000000 #

With the  old arsdate format the output was like this

# FORM1 # 30.07.2000 # 8576 # 777 #  00000000 #

Is it possible to get the same output with the new Date Format ??


Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2150
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: New Date Format CMOD 10.5
« Reply #1 on: January 19, 2023, 02:51:55 PM »
Hi Dani.

Querying mixed date formats isn't going to be easy - it's best left to CMOD by using the arsdoc query command.

If you're going to insist on running the queries in SQL, check out the wiki article on date formats:

You're going to need to determine which tables have old-style date formats and new-style date formats, then convert as appropriate.  There appears to be a built-in function in CMOD called ODDAT that handles the special cases around the different date formats, but I'm not sure that's available to you in DB2.

Let us know how it goes!

IBM CMOD Professional Services:
Call:  +1-866-533-7742  or  eMail:
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR