pulcinella wrote:My output file should be the difference in days (fb=8)
Your requirements do not match your output. The difference between 20110112 and 20120131 is -0000384 days and not 1 year 19 days.
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 be used to calculate the number of days difference between two dates. The result is an 8-byte value consisting of a sign and 7 digits (sddddddd). If the first date is greater than or equal to the second date, the sign is + (plus). If the first date is less than the second date, the sign is - (minus).
// SET CNTMDATE='20120131'
//STEP0100 EXEC PGM=SORT,PARM='JP1"&CNTMDATE"'
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
The output of this is
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