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

Need to convert this to Gregorian Date


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Aug 26, 2009 3:45 pm
Reply with quote

Hi, We receive a file input as shown below:

Code:

0032
9128
8136


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
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Wed Aug 26, 2009 3:57 pm
Reply with quote

How will you get the date for 31 dec 2011?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Aug 26, 2009 6:53 pm
Reply with quote

It might be like this.....

Code:

1365


Thanks.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 26, 2009 7:07 pm
Reply with quote

Would 0032 be 2/1/2010 or 2/1/2000?
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Wed Aug 26, 2009 7:27 pm
Reply with quote

Didn't Y2K teach us anything?? icon_rolleyes.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Aug 26, 2009 7:33 pm
Reply with quote

Terry Heinze wrote:
Didn't Y2K teach us anything?? icon_rolleyes.gif

Sure did - grab the overtime while it's going icon_lol.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 26, 2009 7:52 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Aug 26, 2009 7:58 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Aug 26, 2009 8:05 pm
Reply with quote

sickening approach icon_eek.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Aug 26, 2009 9:14 pm
Reply with quote

Hello,

Quote:
sickening approach
Ahh - understated icon_smile.gif

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Aug 26, 2009 10:02 pm
Reply with quote

You can take a horse to the water but cannot make it to drink water..... icon_lol.gif

We explained a lot but they are not ready to heed....... nothing much to add...

Thx.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Aug 26, 2009 10:21 pm
Reply with quote

Hello,

Quote:
We explained a lot but they are not ready to heed.......
And this is (unfortunately) quite common. . . icon_sad.gif
Back to top
View user's profile Send private message
scerwdriver

New User


Joined: 16 Mar 2009
Posts: 11
Location: Pune

PostPosted: Thu Aug 27, 2009 10:37 pm
Reply with quote

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. icon_smile.gif

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Aug 27, 2009 11:00 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 28, 2009 8:47 am
Reply with quote

Craq, how to do that? We will propose it.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 7
No new posts Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts CONVERT a given date from UTC TO BST CICS 0
Search our Forums:

Back to Top