So, hier nun meine funktionierende V6R1-Quelle mit CCSID 1252:
Damit wird zwar eine IFS-Datei mit 819 erstellt, das ist aber von 1252 nicht weit entfernt.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;
Auf V7 sollte das auch mit 1252 funktionieren.
Bookmarks