View previous topic :: View next topic
|
Author |
Message |
pnkumar Warnings : 2 New User
Joined: 27 Oct 2005 Posts: 24
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Or you could use the macro DATECONV that come with Easytrieve.
%DATECONV datein YYDDD dateout MMDDCCYY |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thanks Douglas
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 |
|
|
Bill Murrell
New User
Joined: 14 Sep 2008 Posts: 10 Location: Oklahoma City, OK
|
|
|
|
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 |
|
|
|