Tried few modification but still it writes only 1 dcd to all.dcd
Code:
open read unit 51 file name ../output/@i/unfold_1le0.job0.@i.sort.dcd
open read unit 52 file name ../output/@i/unfold_1le0.job1.@i.sort.dcd
TRAJ QUERY UNIT 51
TRAJ QUERY UNIT 52
calc ntot = 2 * ?nfile

TRAJECTORY FIRSTU 51 NUNIT 2 IREAD BEGIN 0 SKIP 1
!!!!!TRAJ READ

!!!!!!!!!!open unit 61 write file name @odcd
open write unit 61 file name ./../anal/recen/@i/unfold_1le0.joball.@i.recen.dcd

! Here you need the same set of image or crystal definitions as were used 
! when the trajectory was created	
crystal define CUBIc  50. 50. 50. 90.0 90.0 90.0
crystal build noper 0

! Image statemnts for those molecules that should be recentered
image byresidue sele all end
 
merge firstu 51 nunit 2 skip 1 output 61 nfile @NTOT begin 0 stop 8000 -
  orient recenter sele all end sele segid PRT .and. .not. hydrogen end