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: 113
Location: India

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: 6966
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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