FTP from PC Server to AS/400

pts.
Tags:
Hardware
I am sending a CSV file to the AS/400 and I am losing leading blanks from my columns. Is there any keyword that I have to use to prevent this? The method of transfer is STRTCPFTP RMTSYS(*INTNETADR) INTNETADR(&PSIPADR) using the following source script: get transfer/itmfile.csv translib/itmfile (replace

Answer Wiki

Thanks. We'll let you know when a new response is added.

Old question, old answer.
CSV (Comma separated values) is a protocol to compactly transfer ascii data. Leading blanks, trailing blanks, as NULL characters are NOT transferred. Justification of the received file into columns that you place as data in fields, or values in cells, is the responsibility of the receiving program.
Option 1 is to replace the NULL characters with a non-printing, non-numerical character. If your blanks were actually SPACES (ascii32/hex20) then use ascii255/hexff.
This puts the load of preparation on the PC.
Option 2 (the preferred method) is to do justification on the received data as it is placed in fields or spreadsheet cells. Standard string formatting allows you to ‘right’ fill the string and automatically create you missing leading blanks. This puts the load on the AS/400 , where I think it belongs, and keeps the transfer to the simple standard. (Tab separated files [common extension .txt] would have the same problem because the intent is the same compact the data in transit.)
Alternate file formats exist for business/accounting data with fixed width columns and specified left/right strings. Note these formats bloat very quickly as all the ‘empty’ spaces have to be transferred also.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following