Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6968
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 Compare yesterday's date to the one o... migusd SYNCSORT 4 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us