View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Hi, We receive a file input as shown below:
The sender says that it is a Y & DDD date in the input file and needs to be converted to Gregorian date (either CCYYMMDD or MMDDCCYY).
Expected Output:
Code: |
2000/02/01
2009/05/08
2008/05/15
|
OR
Code: |
02/01/2000
05/08/2009
05/15/2008
|
How to achieve this?
Thanks. |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
How will you get the date for 31 dec 2011? |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
It might be like this.....
Thanks. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Would 0032 be 2/1/2010 or 2/1/2000? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Didn't Y2K teach us anything?? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Terry Heinze wrote: |
Didn't Y2K teach us anything?? |
Sure did - grab the overtime while it's going |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
How to achieve this? |
1. Perform analysis to determine every program using the dates.
2. Change every program to use new date format.
3. Write a program to convert the dates to Gregorian.
4. Run program to convert the dates.
5. Implement all changed programs in production.
6. Wait for the abends from the programs that were missed in steps 1 & 2. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
We are looking for 2010 onwards. This is for a time frame of 10 years and after that we would like the conversion to be 2020, 2021 and so on......
Thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
sickening approach |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
sickening approach |
Ahh - understated
If they can get thru this decade's "rollover", they will probably all be gone (one way or another) by the time the next rollover occurs.
And no manager will ever be held accountable for the wasted cost continuing this mess. . . |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
You can take a horse to the water but cannot make it to drink water.....
We explained a lot but they are not ready to heed....... nothing much to add...
Thx. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
We explained a lot but they are not ready to heed....... |
And this is (unfortunately) quite common. . . |
|
Back to top |
|
|
scerwdriver
New User
Joined: 16 Mar 2009 Posts: 11 Location: Pune
|
|
|
|
hi,
Please try following in excel sheet
DATE(YEAR("01/01/"&TEXT(1900+INT(A2/1000),0)),MONTH("01/01/"&TEXT(1900+INT(A2/1000),0)),DAY("01/01/"&TEXT(1900+INT(A2/1000),0)))+MOD(A2,1000)-1
the logic can be used in REXX... try this with REXX code.
this will convert 109128 to 08/05/2009
that means you need to add "10" before every code
eg.
0032---- 100032
9128 ---- 109128
8136 ----- 108136 |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What does MS-Excel have to do with Mainframe programming. You can convert the dates in the format given if you make changes every ten years. |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
Craq, how to do that? We will propose it. |
|
Back to top |
|
|
|