I download a text file using CPYTOIMPF with record delimiter as CRLF. As requirement the delimiter as CRLF is correct for all lines except last line where there should not be any delimiter. Since this command auto adds delimiter to all lines how can i control this for last line ? there should not be any new line in text file at the end.
CPYTOIMPF FROMFILE(TESTFILE *FIRST) TOSTMF('/TEST.TXT') MBROPT(*REPLACE) FROMCCSID(874) STMFCODPAG(874) RCDDLM(*CRLF) STRDLM(*NONE) RMVBLANK(*TRAILING) FLDDLM(',') ORDERBY(*NONE) ADDCOLNAM(*NONE)