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

Converting 2 digit year to 4 digit year using DB2


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

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Fri Mar 18, 2011 12:04 pm
Reply with quote

Hi,
I need to convert 2 digit year to 4 digit year using DB2. Are there any inbuilt functions or db2 sqlpl procedures available? If not, if any code exists, could it please be shared?

Thank you very much.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Mar 18, 2011 9:18 pm
Reply with quote

Hi Vasif,

You can try,
Code:
SELECT '20'||twodigityearcolumn from creator.tablename;


to add century and make it 4 digit. You need to have some logic to guess whether its 19 or 20.

Thanks,
Sushanth
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top