XCOM AS400 to Windows csv file has trailing spaces on each row
search cancel

XCOM AS400 to Windows csv file has trailing spaces on each row

book

Article ID: 380575

calendar_today

Updated On:

Products

XCOM Data Transport XCOM Data Transport - Windows

Issue/Introduction

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)

Environment

XCOM™ Data Transport® for AS/400
XCOM™ Data Transport® for Windows

Cause

A file on AS/400 has a fixed record length and text will be padded with spaces. This is not XCOM specific behaviour.

Resolution

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.

Additional Information

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.