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
 

 

A query to convert julian date to db2 date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: A query to convert julian date to db2 date
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 01, 2010 6:01 pm    Post subject: Reply to: A query to convert julian date to db2 date
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: 2285
Location: @my desk

PostPosted: Wed Dec 01, 2010 6:02 pm    Post subject:
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    Post subject:
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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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