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: 2238
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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