×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




If the data in your file is plain us ascii then you can just send it as is.
On Nov 18, 2015 02:10, "Steve Landess" <sjl_abc@xxxxxxxxxxx> wrote:

IBM I 7.1
------------

Customer wants a UTF-8 text file, so we created a PF with data encoded as
CCSID(1208) and used FTP to do a PUT (Using BINARY mode) onto their FTP
server (NOT IBM I, probably Windows, not sure).

The customer came back and indicated that what they /really/ needed is
UTF-8 with <CR><LF> delimiters on each record.

When using IBM i to PUT an EBCDIC-encoded [ for example, CCSID(37) ] to
another system, if BINARY is not specified on the PUT then FTP will
translate the EBCDIC to ASCII and put <CR><LF> on each record on the target
file. We tried using FTP with the CCSID(1208) file, and it seems that IBM
i FTP also translates CCSID(1208) to ASCII during the PUT.

NOT good.

After much experimentation and frustration, the solution which I devised
was to use CPYTOIMPF to copy the UTF-8 PF to an IFS file:

CPYTOIMPF FROMFILE(UTF8FILE) TOSTMF('/home/steve/test.txt')
MBROPT(*REPLACE) RCDDLM(*CRLF) STRDLM(*NONE) RMVBLANK(*TRAILING)

Then used FTP to PUT the IFS file (using BINARY mode) to the target system.

This gave them what they wanted - Is there a better way?

-sjl





--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.