× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Steve

I'm inclined to suggest 2 options

1. Don't make your PF 1208 - instead, use a parameter on CPYTOIMPF or CPYTOSTMF to set the CCSID of the IFS file.

2. Write directly to the IFS file - you can roll your own using IFS APIs or use Scott Klement's IFS service program.

HTH
Vern

On 11/17/2015 7:09 PM, Steve Landess 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







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-2024 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.