If we used for Monday created GDG input file means it doesnt have previous day record..for this case we go for friday date record(that is 2 day in advance)..for example SEE THE FILE Header date is 10th may2010(Monday),but it has friday date record(20100507) at the position 8-15 Please let me know,if anything more I am eagerly waiting for the solution
You try to complicate a simple request. From what I understood till now is that
1. Header record will have the current day date
(can be monday thru friday)
2. The detail records will have the prior day records.
If that is true then use the following DFSORT JCL.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
//SORTIN DD DSN=your input fb 88 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OVERLAY=(11:C'0000002 0000001 000001 ',100,6,48X))
OUTFIL BUILD=(1,88),INCLUDE=(100,1,CH,GT,C' ')
PS: If your header date has anything other than current date and if you want to do the comparison, then you need to write a program to perform the date arithmetic on any given date as sort products do not have capability of performing date arithmetic on any date.