Und da bin ich auch schon wieder.
Also das mit dem BOM klappt soweit(letzten Tests stehen noch aus).
Aber wie bereits von Teilnehmern aus dem Forum angemerkt, funktionieren die Umlaute nicht.
Diese werden im Spool sauber angezeigt.
Im Zielsystem sind diese jedoch kaputt.
Ich habe mir iConv angesehen und auch versucht zu implementieren, aber aus meiner Sicht gibt es keinen Unterschied.

Folgendes habe ich aufgenommen:

PHP-Code:
F*------------------------------------------------------------------    
FPrototype for Code Conversion Open                                 
F
*------------------------------------------------------------------    
D IConvOpen       PR            52A   ExtProc('QtqIconvOpen')           
D  fromcode                       *   Value options(*string)            
D  tocode                         *   Value options(*string)            
 
 *------------------------------------------------------------------    
 * 
Prototype for Code Conversion                                        
 
*------------------------------------------------------------------    
D IConv           PR            10i 0 ExtProc('iconv')                  
D                               52a   Value                             
D                                 
*   Value                             
D                               10i 0 Value                             
D                                 
*   Value                             
D                               10i 0 Value                             
 
 
****************************************************************  
 *  
Code Page Conversions  (iconv_t)                               
 ***************************************************************** 
D ToAscii         DS                                               
D  ICORV_A                1      4b 0                              
 
*                  return value to indicate if error occurred     
D  ICOC_A                 5     52b 0 DIM
(00012)                   
 *                                        
cd                       
 
*                                                                 
D ToEbcdic        DS                                               
D  ICORV_E                1      4b 0                              
 
*                  return value to indicate if error occurred     
D  ICOC_E                 5     52b 0 DIM
(00012)                   
 *                                        
cd                       
 
*                                                                 
D**                                                                
D**                                                                
D p_Qascii        S               *   inz(%addr(Qascii))           
D Qascii          DS            32                                 
D  asciiCP                1      4b 0 inz
(00813)                   
 
D  asciiCA                5      8b 0 inz(0)                   
D  asciiSA                9     12b 0 inz(0)                   
D  asciiSS               13     16b 0 inz(1)                   
D  asciiIL               17     20b 0 inz(0)                   
D  asciiEO               21     24b 0 inz(1)                   
D  asciiR                25     32a   inz(*allx'00')           
D**                                                            
D p_Qebcdic       S               *   inz(%addr(Qebcdic))      
D Qebcdic         DS            32                             
D  ebcdicCP               1      4b 0 inz
(00037)               
D  ebcdicCA               5      8b 0 inz(0)                   
D  ebcdicSA               9     12b 0 inz(0)                   
D  ebcdicSS              13     16b 0 inz(1)                   
D  ebcdicIL              17     20b 0 inz(0)                   
D  ebcdicEO              21     24b 0 inz(1)                   
D  ebcdicR               25     32a   inz(*allx'00')           
D**                                                            
D CHAR10          S             10A   BASED (P
In den C-Bestimmungen dann:

PHP-Code:
C                   MOVE      *BLANKS       MSGTODSPLY       52        
C                   Z
-ADD     0             rc               50 0      
C                   MOVE      
*BLANKS       XMLSTR2                    
 
translate response to ASCII                                         
C                   
eval      rc IConv(                              
C                                        ToAscii:                      
C                                        %addr(XMLSTR):                
C                                        %len(%trimr(XMLSTR)):         
C                                        %addr(XMLSTR):                
C                                        %len(%trimr(XMLSTR))          
C                                        )                             
C                   if        ICORV_A 0                              
C                   
eval      MsgToDsply 'Error in Translate'        
C     MsgToDsply    dsply                                              
C                   
endif                                              
C** 
Zusätzlich habe ich die *INZSR noch aufgenommen wo folgendes drin steht:
PHP-Code:
Csr   *INZSR        begsr                                         
 
setup code page conversion ebcdic ascii                      
C                   
eval      ToAscii  IConvOpen(p_Qascii:      
C                                        p_Qebcdic)               
C                   if        ICORV_A = -1                        
 
error processing here                                          
C                   
endif                                         
 
 * 
setup code page conversion ascii ebcdic                      
C                   
eval      ToEbcdic IConvOpen(p_Qebcdic:     
C                                        p_Qascii)                
C                   if        ICORV_E = -1                        
 
error processing here                                          
C                   
endif                                         
 *                                                                
Csr   #INZSR        endsr 
Also die Ansicht im Spool und das Ergebnis im Zielsystem ist mit meinem iConv-Versuch das gleiche.
Die Umlaute passen leider nicht.
Nach dem Aufruf von iConv wird XMLSTR mittels EXCPT ausgegeben.

PHP-Code:
O          E            EXCXML         1                 
O                       XMLSTR             198