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
 

 

Help adding century to YYMMDD date

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

New User


Joined: 14 Dec 2006
Posts: 6
Location: Ohio

PostPosted: Fri Apr 29, 2011 7:53 pm    Post subject: Help adding century to YYMMDD date
Reply with quote

I am trying to add a century to a date in YYMMDD format. I want the century to be determined by using the current year as the window (i.e. current year or less will be filled with 20 as century, otherwise 19).

I was able to use Y2PAST=100 to get the century to populate, however current year fills with 19 instead of 20.

Code:

OPTION COPY,Y2PAST=100
INREC BUILD=(1,6,Y2T,TOGREG=Y4T)


I tried to change Y2PAST=100 to Y2PAST=101 thinking this would work, but it now gives me OPERAND DEFINER ERROR.

Is there any modification I could use to do this with Y2PAST?

If I were to need to go the IFTHEN route, can the YY part of DATE1 be isolated?

Thank you,

Lee
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Apr 29, 2011 9:05 pm    Post subject:
Reply with quote

Quote:
current year or less will be filled with 20 as century, otherwise 19)


Do you mean you want the following?

Code:

99mmdd -> 1999mmdd
...
13mmdd -> 1913mmdd
12mmdd -> 1912mmdd  > current year
11mmdd -> 2011mmdd  = current year
10mmdd -> 2010mmdd  < current year
09mmdd -> 2009mmdd
...
00mmdd -> 2000mmdd

If not, show what you do want.
Back to top
View user's profile Send private message
leedtech

New User


Joined: 14 Dec 2006
Posts: 6
Location: Ohio

PostPosted: Fri Apr 29, 2011 10:03 pm    Post subject: Reply to: Help adding century to YYMMDD date
Reply with quote

Frank,

That is the desired result.

Lee
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Apr 30, 2011 1:17 am    Post subject:
Reply with quote

You could use Y2PAST=1912, but then you'd have to add 1 each year.

Or you could use Y2PAST=100 with the following DFSORT control statements which will fix the current year:

Code:

  OPTION COPY,Y2PAST=100                                         
  INREC IFOUTLEN=8,                                             
   IFTHEN=(WHEN=INIT,                                           
    BUILD=(1,6,Y2T,TOGREG=Y4T,9:DATE2)),                         
   IFTHEN=(WHEN=INIT,OVERLAY=(15:9,4,ZD,SUB,+100,EDIT=(TTTT))), 
   IFTHEN=(WHEN=(1,4,ZD,EQ,15,4,ZD),OVERLAY=(1:9,4))             
Back to top
View user's profile Send private message
leedtech

New User


Joined: 14 Dec 2006
Posts: 6
Location: Ohio

PostPosted: Wed May 04, 2011 7:54 pm    Post subject: Reply to: Help adding century to YYMMDD date
Reply with quote

Frank,

Sorry for delayed response.

I just wanted to thank you for your help.

Lee
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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