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: 2180
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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