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



Scott,

You were absolutely right -- thanks for making the obvious obvious ;-)

The IFS folder was shared and the share had "allow file text conversion"
enabled, so NetServer was trying to do conversion on the file (even though
it had 65535) and corrupting it from a Windows perspective. I disabled
"allow file text conversion" and all is working nicely now....

Kind Regards,

Joe Maguire




From:
Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
To:
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Date:
22/02/2010 10:20
Subject:
Re: BLOB_FILE and CCSID
Sent by:
rpg400-l-bounces@xxxxxxxxxxxx



Hi Joe,

I don't understand the problem. Since your file appears to be a GIF
file, and therefore isn't text, it seems to me that 65535 (*HEX) is the
proper CCSID for the file.

As Windows has absolutely no notion of CCSIDs, I don't see why the CCSID
on a file would affect Windows ability to use it?

Do you get an error when you try to use the file from Windows? Can you
post that error?


Joe.Maguire@xxxxxxxxxxxx wrote:
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 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.