bhaskar_kanteti Active User Joined: 01 Feb 2007 Posts: 120 Location: Hyderabad
In my table the date is of type S9(8) Comp-3 and the value will be YYYYMMDD.
While i am unloading from this table i want the date to be as DDMMYY.
How can i convert this formatting while unloading.
Is there any way to do this.
Craq Giegerich Senior Member Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
If you have a column in a table that is used to store dates why not just define it as a DATE column? I don't think you can rearrange in the unload utility.
You could try something like:
substr(digits(stupid_date),7,2) concat substr(digits(stupid_date),5,2) concat substr(digits(stupid_date),1,4)
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006 Posts: 6970 Location: porcelain throne
reasons I have found for not using DATE datatype are:
1. direct conversion from vsam record to db2 row
2. some places (banks) use feb 30 to indicate end of month since their calculation routines are so primitive.
3. lack of knowledge concerning the power of DATE type calculations in DB2.
in short, ignorance and short sightedness.
being a consultant, I love it.
All times are GMT + 6 Hours