-
ich habe es auf meiner 7.3 Maschine mit Systemwert QCCSID 1141 und Job-CCSID 1141 wie folgt nachgebaut und es funktioniert einwandfrei. Die CCSID der Datei im IFS ist 1208 und auch Notepad++ zeigt UTF8 an.
HTML-Code:
ctl-opt dftactgrp(*no) main(main);
//------------------------------------------------------------------//
// //
// Test - Write CLOB to IFS //
// //
//----------------- //
// R.Ross 05.2020 * //
//------------------------------------------------------------------//
// SQL-Options //
//------------------------------------------------------------------//
exec sql set option datfmt=*iso, timfmt=*iso, commit=*none,
decmpt=*period, closqlcsr=*endactgrp;
//------------------------------------------------------------------//
// Main //
//------------------------------------------------------------------//
dcl-proc Main;
dcl-s LocClob SQLType(CLOB:10000) ccsid(*utf8);
dcl-s LocFile sqltype(CLOB_FILE);
exec sql
set :LocClob = '<p>Test</p>';
LocFile_name = '/home/export/html/test.html';
LocFile_nl = %len(%trim(LocFile_name));
LocFile_fo = SQFOVR;
exec sql
set :LocFile = :LocClob;
end-proc;
//------------------------------------------------------------------//
-
Versuche es doch mal mit 1252 (bitte).
-
So, hier nun meine funktionierende V6R1-Quelle mit CCSID 1252:
Code:
d FBType ds template qualified
d FB1 10i 0
d FB2 10i 0
d FB3 10i 0
d ConvertAPI pr extpgm('CDRCVRT')
d CCSID1 10i 0 const
d ST1 10i 0 const
d S1 1 options(*varsize)
d L1 10i 0 const
d CCSID2 10i 0 const
d ST2 10i 0 const
d GCCASN 10i 0 const
d L2 10i 0 const
d S2 1 options(*varsize)
d L3 10i 0
d L4 10i 0
d FB likeds(FBType)
d StrDS ds
d FileString SQLTYPE(DBCLOB:8000000) ccsid(1200)
d FileData c len(8000000) overlay(FileString)
d varying(4)
d FileBytes a len(16000000) overlay(StrDS:5)
d OutDummy s 10I 0 inz
d OutLen s 10I 0 inz
d OutFB ds likeds(FBType)
d IfsString s 32700a varying(2)
d oPos s 10u 0
d OutDS ds static
d OutSize 10I 0
d OutData a len(8000000)
d OutString a len(8000000) varying(4)
d overlay(OutDS)
// Umwandlen in Win1252-Codepage
ConvertAPI(1200 //CCSID1
:0 //ST1
:FileBytes //S1
:%len(FileData) * 2 //L1
:819 //CCSID2
:0 //ST2
:0 //GCCASN
:OutSize //L2
:OutData //S2
:OutLen //L3
:OutDummy //L4
:OutFB //FB
);
%len(OutString) = OutLen;
for oPos = 1 to OutLen by %size(IfsString);
IfsString = %subst(OutString:oPos);
exec sql values(:IfsString) into :IFS_File;
IFS_File.FILENAME_FO = SQFAPP; // Datei anhängen
endfor;
Damit wird zwar eine IFS-Datei mit 819 erstellt, das ist aber von 1252 nicht weit entfernt.
Auf V7 sollte das auch mit 1252 funktionieren.
-
Hallo an alle,
manches mal verläuft man sich im Wald :-)
Der beeinflussende Faktor ist die Definition dec CLOB Feldes.
PHP-Code:
dcl-s clob sqltype(CLOB:10000) ccsid(1252) ;
dcl-s clob sqltype(CLOB:10000) ccsid(*utf8) ;
dcl-s clob sqltype(CLOB:10000) ccsid(*utf16) ;
Damit legt das System mit dem
PHP-Code:
exec sql values(:clob) into : aHtmlMailFile ;
genau die Datei im IFS an.
Keine Definition bedeutet eben Job CCSID. Das ist eben 273
Danke an alle und gut das es dieses Forum gibt.
Gruß
Michael
-
Wird mit V6R1 leider nicht unterstützt.
Per CDRCVRT kann ich in 1252 umwandeln und dann ins IFS ausgeben.
Die IFS-Datei hat zwar das Attribut 273, Windows ist das aber egal.
Similar Threads
-
By dschroeder in forum NEWSboard Programmierung
Antworten: 2
Letzter Beitrag: 19-12-18, 13:06
-
By msost in forum NEWSboard Programmierung
Antworten: 18
Letzter Beitrag: 07-04-17, 14:23
-
By msost in forum NEWSboard Programmierung
Antworten: 3
Letzter Beitrag: 16-03-17, 13:46
-
By dschroeder in forum IBM i Hauptforum
Antworten: 14
Letzter Beitrag: 31-08-16, 15:32
-
By alex61 in forum IBM i Hauptforum
Antworten: 7
Letzter Beitrag: 06-07-16, 11:51
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks