IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Format date while unloading


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Fri Feb 29, 2008 4:06 pm
Reply with quote

Hi,

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.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Feb 29, 2008 6:43 pm
Reply with quote

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)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Feb 29, 2008 6:59 pm
Reply with quote

Craig,

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top