Future date calculation



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Future date calculation

Postby Aki88 » Mon Dec 29, 2014 10:37 pm

Hello,

I am trying to generate an extract, a part of the process requires calculation of future date using the number of months, which are taken from another position in the same record itself.

An example input record is as below (this record is for illustration only, the actual record layout positions, data differ from this):

2014059ASHFOASHFOUH36KSDGFSDGFSB
2013268ASGFIDGSAIFG48SDKFAGDSFGF
2015348AHDSOFHSODHA59ASIUFHISHFU
2010289SBKDFHAKSFHU10DSAHFKDSHFD


Here starting 7 bytes are date in Y4T format, 2 bytes from 20th position are the number of months to be used for calculation of future date.
The way I'd attempted this was doing it in two steps, first converting Julian to Greg Y4T format, then trying to use 'DATE2+m' form to calculate the future date.
The point where I am stuck is - how to pass the number of months, from my record as shown above, to 'm' for calculation of the date.
When I pass the position in place of 'm', as (20,2,ZD), the job goes for a toss as it expects 'm' to be a numeric value.

If I have it figured the right way then 'DATE2+m', won't be of much help here and I might have to use some other workaround to get this done.

A thought please.

Thanks.
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Future date calculation

 

Re: Future date calculation

Postby BillyBoyo » Tue Dec 30, 2014 12:08 am

There is an ADDMONS function.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Future date calculation

Postby Aki88 » Tue Dec 30, 2014 12:24 am

Thanks a ton Billy, it works like a charm. :D

Cheers; a very happy Christmas + holiday season + advance wishes for the new year...
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post