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

A query to convert julian date to db2 date


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

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Wed Dec 01, 2010 5:26 pm
Reply with quote

Hi All,

I have a file in which the date is defined as follows:

date pic 9(5) comp-3.

The date is displayed in julian format as '9209' and so on. I want to view these packed julian date in db2 format using db2 query. And suggest me how to convert those dates to 01/01/2011.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 01, 2010 6:01 pm
Reply with quote

Assuming the actual julian-date is 2009209, use FUNCTION INTEGER-OF-DAY to convert to Lilian Days then use FUNCTION DATE-OF-INTEGER to convert to its CCYYMMDD format.

Why 01/01/2011? I'm not understanding you or is this the desired template format?

Bill
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 01, 2010 6:02 pm
Reply with quote

Mukesh,

You have a file and you need to convert the date format for a field. Why do you want to involve DB2 into this?
Dont you have any in-house DATE routines?
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Thu Dec 09, 2010 12:13 am
Reply with quote

i have achieved it using ezetrieve...
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts RC query -Time column CA Products 3
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top