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

How to convert Julian date to Gregorion date


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Sat Jul 18, 2009 10:55 am
Reply with quote

Hi,

I am trying to generate a report using Easytrieve where i need to display the date as Gregorion date by taking the value from the file which is in the Julian date format. Please help me how to convert the Julian (YYYYDDD) date to Gregorian date (DDMMYYYY) in Easytrieve.

Thanks in advance.

Thanks
Kumar
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jul 19, 2009 2:40 am
Reply with quote

Hello,

Define a 12-entry array with 2 fields per entry. The first field is the month (defined by a literal 1-12. The other field is the number of days in the year before this month (remember to adjust the feb-dec values for leap year).

To build the julian date use the year from your date field and use the month as the subscript into the array. Add the number of days before this month to the day of your date field giving an unsigned 3-digit julian day.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 20, 2009 4:44 am
Reply with quote

Hello,

Or, make the array items contain 3 fields - 1 for month, 1 for non-leap-year max days and the other for leay-year max days. . .

I mention the field for month to make the code easier for someone to read later. . .

With slight modification, the same process may be used if the month is JAN or OCTOBER or etc.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Jul 20, 2009 8:26 pm
Reply with quote

Or you could use the macro DATECONV that come with Easytrieve.
%DATECONV datein YYDDD dateout MMDDCCYY
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 21, 2009 2:16 am
Reply with quote

Hi Douglas,

Have you successfully used this (DATECONV) to convert from Julian to Gregorian?

I've not been able to find it in the documentation.

d
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Tue Jul 21, 2009 2:32 am
Reply with quote

Yes, we have this in production jobs.
I do not remember exactly where I got it but I keep a copy of a page from "5-4 CA-PanAudit Plus MVS Macro Reference Guide" "Generalized/Statistical Routines D-E 5-5" that gives the syntax.
Quote:
Q: Why do CA-Easytrieve Plus 6.4 and CA-Panaudit Plus 3.0 both contain the PAPLDATE module? Also, can the PAPLDATE module be shared between these products?

A: PAPLDATE is distributed with CA-Easytrieve Plus so that any CA-Easytrieve Plus user can invoke the DATECONV macro (which calls PAPLDATE). CA-Panaudit Plus also distributes DATECONV and PAPLDATE, (along with many other macros and subroutines that are not included in CA-Easytrieve Plus). The DATECONV routine converts a date in one format to another date format. For example, you can convert month-day-year to year-month-day, Julian to Gregorian, and perform similar date conversions.

I found this on: supportconnectw.ca.com/public/app_dev/ca_easytrieve/infodocs/easytrv1000.asp
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 21, 2009 3:08 am
Reply with quote

Thanks Douglas icon_smile.gif

Now, if they'll only include it in the EZT documentation - i was searching in the R11 doc and did not see it. Hopefully, it was not removed. . .

d
Back to top
View user's profile Send private message
Bill Murrell

New User


Joined: 14 Sep 2008
Posts: 10
Location: Oklahoma City, OK

PostPosted: Fri Jul 24, 2009 7:00 pm
Reply with quote

Most shops I'e worked in have pre-written programs that can be called to do the various date conversions needed. Have you tried asking your peers to see if there are such programs at your shop?
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 -> CA Products

 


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 Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top