While using XCOM to transfer a .csv file from AS400 to Windows (destination is shared NAS drive) seeing extra spaces in the last column of each row.
This causes a problem to the downstream program that is processing the file.
The XCOM for AS400 command being used is:SENDFILE RMTSYS(WINDEV1) FILE(TESTFILE) LIB(TESTLIB)
RMTFILE('\\server_name\share_name\testfile.csv')
FILEOPT(*REPLACE) RECFMT(*FB) RECLEN(84) BLKSIZE(30000)
ENQ(*RMTSYS) WAIT(*RMTSYS) BLOCKDATA(*RMTSYS)
XCOM™ Data Transport® for AS/400
XCOM™ Data Transport® for Windows
A file on AS/400 has a fixed record length and text will be padded with spaces. This is not XCOM specific behaviour.
To circumvent the behaviour the xcom.glb file on the 2 destination Windows Servers was changed to have:
REMOVE_TRAIL_BLANKS=YES
After an XCOM service restart a new transfer shows that the received .csv file did not have trailing spaces in the last column of each row.
See XCOM for Windows doc page REMOVE_TRAIL_BLANKS
NOTE: All incoming transfer requests will use this parameter.
If using a comma separated file, it may be required to remove line breaks on Windows.
This can be done with the XCOM for AS/400 parameter TEXTFILE(*NO)
.
However it is also possible that an application like Excel may just ignore the line breaks in the file.