Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Format date while unloading

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Fri Feb 29, 2008 4:06 pm    Post subject: Format date while unloading
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Feb 29, 2008 6:59 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us