Indranil28,
Here's a DFSORT job that will do what you asked for:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
09-11-2007
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT symbol as follows:
* F1,'dd'
* where dd is the day from the file1 record
INREC BUILD=(C'F1,''',4,2,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
03-27-2005
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
* Use F1 symbol to overlay dd in the file2 record
INREC OVERLAY=(4:F1)
/*