Page 1 of 1

future dating, not based on rundate

PostPosted: Tue Dec 02, 2008 10:05 pm
by elpique
Hi.

I'd like to know how to use dsort/icetool future date based on a date in the record, not on the rundate. Specifically, I'd like to add 13 days to the date I receive on a given record. the input date is always in the same position, the output date (input + 13 days) will be in the same position as the input date. In this example, the date starts in position 4, format is YYYYMMDD.

e.g. input looks like

REC120081201DATAX
REC220081204DATAY
REC320081230DATAZ

output should be

REC120081214DATAX
REC220081217DATAY
REC320090112DATAZ

thanks!

Appreciate any help you can give.

Re: future dating, not based on rundate

PostPosted: Tue Dec 02, 2008 11:52 pm
by Frank Yaeger
DFSORT does NOT have any built-in functions for doing that kind of date arithmetic.

Re: future dating, not based on rundate

PostPosted: Tue Oct 26, 2010 4:54 am
by skolusu
elpique,

With PTF UK90025 for z/OS DFSORT V1R10 and PTF UK90026 for z/OS DFSORT V1R12(Oct, 2010), DFSORT now supports date arithmetic which can add/subtract days, months or years to a given date like shown below.

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
----+----1----+----2----+----3----+----4----+----5-
REC120081201DATAX                                 
REC220081204DATAY                                 
REC320081230DATAZ                                 
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                   
  SORT FIELDS=COPY                                 
  INREC OVERLAY=(5:5,8,Y4T,ADDDAYS,+13,TOGREG=Y4T)
//*


The output from the above is
REC120081214DATAX
REC220081217DATAY
REC320090112DATAZ



For complete details of date arithmetic functions and other new functions see "User Guide for DFSORT PTFs UK90025 and UK90026" paper (sortugph.pdf) at:

http://www.ibm.com/support/docview.wss? ... g3T7000242

Re: future dating, not based on rundate

PostPosted: Tue Oct 26, 2010 8:56 pm
by elpique
Thank you!