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
 

 

Need to convert this to Gregorian Date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to convert this to Gregorian Date
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    Post subject:
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    Post subject: Reply to: Need to convert this to Gregorian Date
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    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Wed Aug 26, 2009 7:27 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 26, 2009 7:33 pm    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Wed Aug 26, 2009 7:52 pm    Post subject:
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    Post subject: Reply to: Need to convert this to Gregorian Date
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Aug 26, 2009 8:05 pm    Post subject: Reply to: Need to convert this to Gregorian Date
Reply with quote

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

Site Director


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

PostPosted: Wed Aug 26, 2009 9:14 pm    Post subject:
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    Post subject: Reply to: Need to convert this to Gregorian Date
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

Site Director


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

PostPosted: Wed Aug 26, 2009 10:21 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Need to convert this to Gregorian Date
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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