|
I am receiving a base64 encoded binary file embedded inside an XML document, decoding it back to binary using Scott Klement's subprocedure (thanks Scott) and writing it out to the IFS using a BLOB_FILE object. Simplified code:
D ImageBlob S SqlType(BLOB:4194304)
D ImageFile S SqlType(BLOB_FILE)
// Set output options for BLOB file locator variable ImageFile_fo = SQFOVR; ImageFile_name = '/EDI/TheImage.gif'
ImageFile_nl = %Len(%Trim(ImageFile_name)); // Output the binary data to a file on the IFS EXEC SQL Values :ImageBlob into :ImageFile;
My issue is that the resulting binary file on the IFS has CCSID set to 65535, and is not compatible with the Windows world. I may be missing something obvious, but I cannot find any way to set the CCSID on creation of the file. I have used the following as a work-around for now:
// Set correct CCSID for binary file on the IFS so it can be read from Windows Cmd = 'CHGATR ''' + %Trim(ImageFile_name) + ''' *CCSID 1252'; CallP QCmdExc (Cmd : %Len(Cmd));
Any ideas?
Kind Regards,
Joe Maguire
As an Amazon Associate we earn from qualifying purchases.
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.