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



Ok, I've got a weird problem with CCSID's here. I'm betting the answer is obvious, but I'm missing it.

Got a program that's trying to change the CCSID on a bunch of files.

It copies the data in the files original CCSID to a temporary library (CPYF with CRTFILE(*YES)) ... then does a CHGPF on the original, and then copies the data back from the copy using CPYF with MBROPT(*REPLACE) and FMTOPT(*MAP) so the data is transcoded back to the new CCSID.

The problem we're encounter is: After we copy the original file to the temporary library and then do the CHGPF ... both the original file AND the copy have their CCSID's changed.

The job is running in an appropriate CCSID (5026 in this case). The original file has a CCSID of 937 before the copy ... and the duplicated file has that same CCSID before the CHGPF is run.

The logic is pretty darn simple ...

CPYF FROMFILE(ORIGLIB/ORIGFILE) TOFILE(QTEMP/ORIGFILE) CRTFILE(*YES)
CHGPF FILE(ORIGLIB/ORIGFILE) CCSID(5026)
CPYF FROMFILE(QTEMP/ORIGFILE) TOFILE(ORIGLIB/ORIGFILE) MBROPT(*REPLACE) FMTOPT(*MAP)

(the ORIGLIB & ORIGFILE are both variables, but I know the values are correct).

Oddly enough, if we run the steps by hand (in an interactive job), the copy works perfectly. This problem only happens when we run the copy in a batch job.


Any thoughts? I'm kind of stumped.

As I said, I'm sure it's something obvious ... I just can't see it.

Thanks!

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.