Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Date Conversion from YYYYDDD to YYYYMMDD format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mrdinesh

New User


Joined: 23 Sep 2006
Posts: 24
Location: India

PostPosted: Sat Jan 16, 2016 5:17 pm    Post subject: Date Conversion from YYYYDDD to YYYYMMDD format
Reply with quote

Is there any way in DFSORT to convert Dates. In my case I receive an Input file with the dates yyyyddd format and I would need to convert it to yyyymmdd format. The input file is received in the text format.

Input File:
Code:

DATA1 2015001
DATA2 2015002
DATA3 2015032
DATA4 2015040


I would need to convert this to as

Code:

DATA1 20150101
DATA2 20150102
DATA3 20150201
DATA4 20150209



Thanks,
Dinesh
Back to top
View user's profile Send private message

karthick1990

New User


Joined: 12 Jun 2014
Posts: 4
Location: India

PostPosted: Sun Jan 17, 2016 11:46 am    Post subject: Reply to: Date Conversion from YYYYDDD to YYYYMMDD format
Reply with quote

Yes.

I have option to test for syncsort only, here is the equivalent in syncsort.

Code:

//STEP01   EXEC PGM=SORT                       
//SYSOUT   DD  SYSOUT=*                       
//SORTIN   DD  *                               
DATA1 2015001                                 
DATA2 2015002                                 
DATA3 2015032                                 
DATA4 2015040                                 
//SORTOUT  DD  SYSOUT=*                       
//SYSIN DD *                                   
 OPTION COPY                                   
 INREC BUILD=(1,6,9,5,Y2T,DTNS=(4MD))         
/*                                             


karthick sundarasamy
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jan 18, 2016 3:41 am    Post subject: Reply to: Date Conversion from YYYYDDD to YYYYMMDD format
Reply with quote

mrdinesh

The DFSORT manuals cover date data-types and date functions. If you just ask, instead of trying to find out for yourself, and asking if unsure, you'll never learn how to find anything out.

karthick1990

Two-digit years haven't been used since last century. Why do that, when you have a four-digit year?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 574
Location: The Universe

PostPosted: Mon Jan 18, 2016 4:41 am    Post subject:
Reply with quote

karthick1990

Just to add to Mr. Woodger's comment. Part of the Y2K business from 20 odd years ago was the use of two digit dates. One would have thought that no analyst in their right mind would authorize the use of a 2 digit date except, perhaps, for display purposes. But I see this creeping back into our trade now.

Now I see the year 2100 as being worse than 2000 if us analysts persist in being lazy. 2000, at least, was a leap year. 2100 is not a leap year in the Gregorian calendar, so we will have that issue to deal with in addition to the same date comparison issue that bedeviled us in 2000. Now I grant few people reading this forum will have to deal with 2100 issues 80 some years from now, but if us analysts don't get smart NOW our children, grandchildren and great grandchildren are just going to repeat the Y2K problem all over again.

Part of what brings this to mind is, as I'm writing this, I'm working on a program that takes, in its input, 2 digit years. The data area containing the 2 digit year was designed around 1970, but that's a poor excuse. I can make the program Y2K compatible, but because of the crappy input, I cannot make the program Y2K compliant, much less Y21K capable.
Back to top
View user's profile Send private message
karthick1990

New User


Joined: 12 Jun 2014
Posts: 4
Location: India

PostPosted: Mon Jan 18, 2016 11:29 am    Post subject: Reply to: Date Conversion from YYYYDDD to YYYYMMDD format
Reply with quote

Bill Woodger/Steve-myers,

Seeing the OP's data sample allowing date process here to go on with CENTWIN option to calculate century
is not Good in all the case. yep, with 4 digit year processing things would be better for centuries.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Mon Jan 18, 2016 1:48 pm    Post subject:
Reply with quote

Just want to share my experience, in my site previously, I saw the same. Something like this.
Code:
IF YY < 50
   CC = 20
ELSE
  CC = 19

I told my supervisor that time that it will have impact in the future. What she tells me is if we're still alive by that time.
Back to top
View user's profile Send private message
mrdinesh

New User


Joined: 23 Sep 2006
Posts: 24
Location: India

PostPosted: Tue Jan 19, 2016 12:05 pm    Post subject:
Reply with quote

Thanks Bill. I was able to convert the Julian date to the desired format.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Tue Jan 19, 2016 2:56 pm    Post subject:
Reply with quote

Bill Woodger
Quote:
Two-digit years haven't been used since last century. Why do that, when you have a four-digit year?


SMF is still using that format, accompanied with a century indicator.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jan 19, 2016 3:56 pm    Post subject: Reply to: Date Conversion from YYYYDDD to YYYYMMDD format
Reply with quote

And DFSORT has date formats for SMF dates (and time formats for SMF times).

If you want to consider a two-digit year with a century indicator the same as a two-digit year, fair enough. I was just being humorous. There are two-digit years out there, but there's no need to treat a four-digit year as a two-digit year was the point I was getting at.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us