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
 

 

Custom formatting of timestamp.

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

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Oct 15, 2009 1:40 pm    Post subject: Custom formatting of timestamp.
Reply with quote

Hi

i need to select the timestamp as YYYYMMDDhhmmss format. can any one tell me how to format the timestamp using db2 query.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Oct 15, 2009 1:52 pm    Post subject:
Reply with quote

Arvind,

Thru SUBSTR and various DATE-TIME columnar functions you could have db2 return your formated timestamp.

I imagine that it would be faster to to SELECT/SET your 26 char host variable with a 'normal timestamp' and then create your format thru MOVE statements.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Oct 15, 2009 2:27 pm    Post subject:
Reply with quote

Thank you Dick. i got it using SUBSTR,CHAR and then concatinating all the fields to get as required format.
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 Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Convert Timestamp Value mrdinesh DFSORT/ICETOOL 7 Thu May 05, 2016 6:01 pm
No new posts Formatting data from Excel to mainframe kishpra JCL & VSAM 5 Fri Feb 19, 2016 7:12 pm
No new posts Comparing timestamp in Synscort l.nethaji SYNCSORT 13 Wed Jan 20, 2016 4:47 pm


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