Hier ein Beispiel.

PHP-Code:
 *                                                                                                             
 * 
Prozedurenprototyp für Prozedur 'QMHRTVM'                                                                   
 
*                                                                                                             
dQMHRTVM          PR                  ExtPgm('QMHRTVM')                                                        
d                            32767A   Options(*VarSize)                    <-- Message information             
d                               10I 0 
Const                                --> Length of message information   
d                                8A   
Const                                --> Format name                     
d                                7A   
Const                                --> Message identifier              
d                               20A   
Const                                --> Qualified message file name     
d                            32767A   
Const Options(*VarSize)              --> Replacement data                
d                               10I 0 
Const                                --> Length of replacement data      
d                               10A   
Const                                --> Replace substitution values     
d                               10A   
Const                                --> Return format control characters
d                            32767A   Options
(*VarSize)                    <-> Error code                      
d                               10A   
Const Options(*NoPass)               --> Retrieve option                 
d                               10I 0 
Const Options(*NoPass)               --> CCSID to convert to             
d                               10I 0 
Const Options(*NoPass)               --> CCSID of replacement data       
 
*                                                                                                             
 * 
Datenstruktur für Format 'RTVM0300' für Prozedur 'QMHRTVM'                                                  
 
*                                                                                                             
dRTVM0300         DS                                                                                           
d RTVMByteRtn                   10I 0                                      
<-- Bytes returned                  
d RTVMByteAvl                   10I 0                                      
<-- Bytes available                 
d RTVMMsgSvrty                  10I 0                                      
<-- Message severity                 
d RTVMAltIdx                    10I 0                                      
<-- Alert index                      
d RTVMAltOpt                     9A                                        
<-- Alert option                     
d RTVMLogInd                     1A                                        
<-- Log indicator                    
d RTVMMsgId                      7A                                        
<-- Message ID                       
d RTVMRsrvd                      3A                                        
<-- Reserved                         
d RTVMNSVF                      10I 0                                      
<-- Number of SVF                    
d RTVMCCSID1                    10I 0                                      
<-- CCSID CSI of text                
d RTVMCCSID2                    10I 0                                      
<-- CCSID CSI of replacement data    
d RTVMCCSID3                    10I 0                                      
<-- CCSID of text returned           
d RTVMOffDR                     10I 0                                      
<-- Offset of default reply          
d RTVMLenDRRtn                  10I 0                                      
<-- Length of default reply returned 
d RTVMLenDRAvl                  10I 0                                      
<-- Length of default reply available
d RTVMOffMsg                    10I 0                                      
<-- Offset of message                
d RTVMLenMsgRtn                 10I 0                                      
<-- Length of message returned       
d RTVMLenMsgAvl                 10I 0                                      
<-- Length of message available      
d RTVMOffMsgH                   10I 0                                      
<-- Offset of message help           
d RTVMLenMsgHRtn                10I 0                                      
<-- Length of message help returned  
d RTVMLenMsgHAvl                10I 0                                      
<-- Length of message help available 
d RTVMOffSVF                    10I 0                                      
<-- Offset of SVF                    
d RTVMLenSVFRtn                 10I 0                                      
<-- Length of SVF returned           
d RTVMLenSVFAvl                 10I 0                                      
<-- Length of SVF available          
d RTVMLenSVFElm                 10I 0                                      
<-- Length of SVF element            
d RTVMVarAra                  4096A                                        
<-- Varriable area                   
*                                                                                                           
Datenstruktur für Format 'ERRC0100' für Fehlercode                                                        
*                                                                                                           
ERRC0100         DS                                                                                         
 ERRCBytePrv                   10I 0 Inz
(272)                             --> Bytes provided                
 ERRCByteAvl                   10I 0                                      
<-- Bytes available               
 ERRCExcId                      7A                                        
<-- Exeption-Id.                  
 
ERRCRsrvd                      1A                                        <-- Reserved                      
 ERRCExcDta                   256A                                        
<-- Exeption data                 
*                                                                                                           
Sonstige Felddeklarationen                                                                                
*                                                                                                           
ITMsgId          S              7A                                        Nachrichten-Id.                   
ITMsgF           S             10A                                        Nachrichtendatei                  
ITLibMsgF        S             10A                                        Bibliotehk Nachrichtendatei       
ITMsgFL          S            256A                                        Nachricht der ersten Ebene        
ITMsgSL          S           2048A                                        Nachricht der zweiten Ebene       
*                                                                                                           
*-------------------------------------------------------------------------------------------*               
*                                                                                                           
Nachrichtendaten aus Nachrichtendatei abrufen                                                             
                   Reset                   ERRC0100                                                         
                   CallP     QMHRTVM
(RTVM0300 :                           <-- Message information           
                                     
%Size(RTVM0300) :                    --> Length of message information 
c                                     
'RTVM0300' :                         --> Format name                     
c                                     ITMsgId 
:                            --> Message identifier              
c                                     ITMsgF 
ITLibMsgF :                 --> Qualified message file name     
c                                     
*Blanks :                            --> Replacement data                
c                                     
*Zero :                              --> Length of replacement data      
c                                     
'*NO' :                              --> Replace substitution values     
c                                     
'*YES' :                             --> Return format control characters
c                                     ERRC0100 
:                           <-> Error code                      
c                                     
'*MSGID' :                           --> Retrieve option                 
c                                     0 
:                                  --> CCSID to convert to             
c                                     0
)                                   --> CCSID of replacement data       
c                   
If        ERRCExcId = *Blanks                                                              
 
Nachrichtentext erster Ebene                                                                                
c                   
Eval      ITMsgFL =                                                                        
c                             %SubSt(RTVM0300:RTVMOffMsg+1:RTVMLenMsgRtn)                                      
 * 
Nachrichtentext zweiter Ebene                                                                               
c                   
Eval      ITMsgSL =                                                                        
c                             %SubSt(RTVM0300:RTVMOffMsgH+1:RTVMLenMsgHRtn)                                    
c                   EndIf 
In der Variablen ITMsgId muss die Nachrichten-Id., in der Variablen ITMsgF muss die Nachrichtendatei und in der Variablen ITLibMsgF muss die Bibliothek der Nachrichtendatei stehen.