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



Why ever the SQL precompiler ignores the CCSID!
What you could do is to replace an existing IFS file with the expected
CCSID, or you could create an IFS file for an XML_CLOB (default CCSID os
1208) ... or even better use the new IFS_WRITE or IFS_WRITE_UTF8 functions
to write directly with SQL into he IFS.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser


"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Maria
Lucia Stoppa
Sent: Montag, 23. August 2021 15:00
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: How does SQL determine the CCSID when creating a file on IFS using
CLOB_FILE SQL variable type?

Hi all,

Hope your holidays are going superbly!

Meanwhile, I am unsuccessfully trying to write a UTF-8 file on the IFS.
That's what I have done:

- the job is running with CCSID(280) inherited from QCCSID
- the HTTPCLOBVERBOSE SQL function returns UTF-8 data (which I want to
save) into a CCSID(1208) variable:
- dcl-ds http inz; // http call
...
responseMsg sqltype(CLOB: 2000000) inz ccdid(1208);
// http response utf-8 message
...
end-ds;
- this is the definition of a temporary variable
- dcl-s pdfDataFinal like(http.responseMsg); // same dimension as http
body
response
- this is the definition of the IFS destination
- dcl-s ifsPdfFile sqltype(CLOB_FILE) ccsid(*utf8); // I tried 1208
as well
- this is how I create the file
- pdfDataFinal = %trim(http.responseMsg);
// some stuff here
ifsPdfFile_NAME = %trim(fileFullPathName); // file name
ifsPdfFile_NL = %len(%trim(ifsPdfFile_NAME)); // name length
ifsPdfFile_FO = SQFOVR;
// SQFOVR= override, SQFCRT=create, SQFAPP=append, SQFRD=read-on
- so far so good, then I create the file:
- exec sql set :ifsPdfFile = trim(:pdfDataFinal);
- and the file in IFS is CCSID(280), no matter what! The receiving
folder is coded 1208, but the newly created file in the folder is 280
(seen
from WRKLNK).

Looking at the compilation spool file I looked at the variable definition:
227 //*DCL-S IFSPDFFILE SQLTYPE(CLOB_FILE) CCSID(*UTF8); // CCSID UTF-8

228 DCL-DS IFSPDFFILE;
//SQL
229 IFSPDFFILE_NL UNS(10);
//SQL
230 IFSPDFFILE_DL UNS(10);
//SQL
231 IFSPDFFILE_FO UNS(10);
//SQL
232 IFSPDFFILE_NAME CHAR(255) CCSID(1208);
//SQL
233 END-DS IFSPDFFILE;
//SQL

It seems to me that only the file name has the CCSID UTF-8 set, not the
content, though the data part of the variable is not explicit.

I tried changing the CCSID of the running job to 1208, but it revealed
impossible, but I couldn't find any other documentation.

Does any of you know how to do this?

Thank you very much
Kind regards
Lucia


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.