If the input file and output file is Variable format then need to use Record length to write into output file.

//XXXX EXEC PGM=XXXXXXX
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//PANDD DD DSN=XXXXXXX.XXXX.XXXXXXXX,DISP=SHR
//*
//FILEIN DD DISP=SHR,DSN=xxxxxxx.xxxx.xxxxxxxx
//FILEOUT DD DSN=xxxxxxx.xxxx.xxxx.xxxxxxxx.xxx,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(250,230),RLSE),
// DCB=(LRECL=854,RECFM=VB,BLKSIZE=0),UNIT=xxxxx
//SYSIN DD *

FILE FILEIN
IN-xxx 01 2 N
IN-xecx 04 4 A
IN-xec1 10 2 N

*
FILE FILEOUT
xxxREC 001 854 A

JOB INPUT FILEIN
IF IN-xxx NUMERIC AND IN-xxx = 54
FILEOUT:RECORD-LENGTH = FILEIN:RECORD-LENGTH
PUT FILEOUT
END-IF
*