FWiW on v5r3, even without any file named ENVELOPE in *LIBL, the result is shown following the request:

CPYTOIMPF FROMFILE(ENVELOPE) TOSTMF('/tmp/ALEXANDER.xml')
MBROPT(*REPLACE) TOCCSID(437) RCDDLM(*CRLF) DTAFMT(*FIXED)
CPD281B TOCCSID not valid when output file is a stream file.
CPF0001 Error found on CPYTOIMPF command.

That error is because the TOCCSID parameter is for export to a database file. On newer release(s) there is a STMFCCSID parameter to replace the STMFCODPAG parameter.

But the CCSID 37 is /correct/ for USA and Portugal, but that is an EBCDIC CCSID. The CCSID 437 is "USA PC-DATA" ASCII. There are likely better choices for ASCII, but it should be valid for STMFCCSID(437).

FWiW if the /program/ invoking the request is SQLRPG vs RPG, or that program or a prior invokes the SQLCLI, there were issues in the past which require only server-mode SQLCLI to prevent /sequence error/ issues with the export\import use of the SQLCLI.

Regards, Chuck

On 05 Apr 2013 22:24, Gary Kuznitz wrote:
Is the CCSID supposed to be 37 for the USA? Could that be the
problem?

On 5 Apr 2013 at 22:20, Gary Kuznitz wroet:


When I run it in on the test side within the program it runs fine.
The records get coppied.
When I run it on the live side within the program it doesn't copy
the records. When I run it
on the live side from the cmd line it does copy the records.
CPYTOIMPF FROMFILE(ENVELOPE) TOSTMF('/tmp/ALEXANDER.xml')
MBROPT(*REPLACE) TOCCSID(437) RCDDLM(*CRLF) DTAFMT(*FIXED)
I don't see what the difference is between running the cmd inside
the program and from the cmd line with everything else being equal.


This thread ...

Follow-Ups:

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.