I am not able to create support ticket even though I created the account to login and to create a case. However, here is the example JCL.
//STEP020A EXEC PGM=SORT
//SORTIN DD *
20043171303668
20043350826498
20221350826498
20222421662738
20223361662738
20223561648018
20223620823858
20233640825308
20241640925398
20242421425838
/*
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,7,CH,GE,&DATE3-731)
/*
So, SORTOUT should so only show last 2 years of data during everyday execution. Date is in 'YYYYDDD' format for 1st 7 characters. DATE3 always takes current day and minus 731 is to minus 731 days from current day to get approx 2 years back dated date. Any assistance from this channel will be helpful. If this is not possible, then, what is the alternative. but I would like to use any sort utility (DFSORT, ICEMAN or ICETOOL) instead of writing a program.