priyasingh wrote:i need it in JCL only. Plz help. I need it urgently
Everyone does NOT work in the same timezone as you are working and please stop demanding solution. You neither provided the LRECL and RECFM of the input files involved nor you showed a sample of input and desired output, but you do demand a complete solution .
Use the following DFSORT JCL which will give you the desired results. I assumed that your input is RECFM=FB and LRECL=80
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
RECORD # 1 2012-10-16
//INB DD *
RECORD # 2 2012-10-15
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(81,8,A)
JOINKEYS F2=INB,FIELDS=(81,8,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,80,?)
INCLUDE COND=(81,1,CH,EQ,C'1')
INREC BUILD=(1,80)
//*
//JNF1CNTL DD *
OPTION STOPAFT=1
INREC OVERLAY=(81:16,10,UFF,M11,LENGTH=8)
//*
//JNF2CNTL DD *
OPTION STOPAFT=1
INREC OVERLAY=(81:16,10,UFF,M11,LENGTH=8)
//*