upendra_water,
Here is alternative way of doing it in a single step/pass of data if you don't have the Nov 2009 PTF installed.
we concatenate a single line HDR record before each file and then create a seqnum which will we use to sort and get the records in the desired order.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HDR
// DD *
RECORD-1
RECORD-2
RECORD-3
RECORD-4
// DD *
HDR
// DD *
RECORD-5
RECORD-6
RECORD-7
RECORD-8
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(82,8,CH,A)
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1)),
IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(82:SEQNUM,8,ZD,START=1,INCR=2)),
IFTHEN=(WHEN=(81,1,ZD,EQ,2),OVERLAY=(82:SEQNUM,8,ZD,START=2,INCR=2))
OUTFIL STARTREC=3,BUILD=(1,80)
//*