praveen_nayak17,Just to clarify, do you want records that have a timestamp/date field which is more than 7 days from the current system date, meaning over a week old?
If this is the case, then the following sort job will give you the desired output:
//SORT1 EXEC PGM=SORT
//SORTIN DD *
2009-01-20-12-00-00-00000
2009-01-04-12-00-00-00000
2008-12-20-12-00-00-00000
2009-01-18-12-00-00-00000
2008-06-10-12-00-00-00000
2009-01-13-12-00-00-00000
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,10,CH,LT,&DATE1(-)-7)
/*
The following records will be included in the output:
2009-01-04-12-00-00-00000
2008-12-20-12-00-00-00000
2008-06-10-12-00-00-00000