Mira si te sirve esto:
 
    100       *  ==================================================================                            
    200       *  = Service program... CBX007                                      =                            
    300       *  = Description....... Job log message routines                    =                            
    400       *  =                                                                =                            
    500       *  = CrtRPGMod  Module( CBX007 )                                    =                            
    600       *  = CrtSrvPgm  SrvPgm( CBX007 ) Module( CBX007 ) Export( *All )    =                            
    700       *  ==================================================================                            
    800      H DECEDIT('0,') ALTSEQ(*EXT) DATEDIT(*DMY.)                      
    900      H*NoMain  Option( *SrcStmt )                                      
   1000       *-- API error data structure                                    
   1100      D ApiError        Ds                                              
   1200      D  AeBytPrv                     10i 0 Inz( %Size( ApiError ))    
   1300      D  AeBytAvl                     10i 0                            
   1400      D  AeExcpId                      7a                              
   1500      D                                1a                              
   1600      D  AeExcpDta                   128a                              
   1700       *-- Get joblog message procedure prototype                      
   1800      D*GetLogMsg       Pr                                              
   1900      D*GetLogMs                     512a   Varying                    
   2000      D* PxJobId                      26a   Const                      
   2100      D* PxMsgOpt                      6a   Const                      
   2200      D* PxMsgKey                      4a   Options( *NoPass )          
   2300       *-- Get joblog message procedure                                
   2400      P*GetLogMsg       B                   Export                      
   2500      D*                Pi                                              
   2600      D*GetLogMs                     512a   Varying                    
   2700      D* PxJobId                      26a   Const                      
   2800      D* PxMsgOpt                      6a   Const                      
   2900      D* PxMsgKey                      4a   Options( *NoPass )          
   3000       *-- API parameters                                              
   3100      D JlMsgInfLen     s             10i 0 Inz( %Size( JlMsgInf ))    
   3200      D JlSltInfLen     s             10i 0 Inz( %Size( JlSltInf ))    
   3300      D JlGetRcdNbr     s             10i 0                            
   3400      D JlRtnRcdNbr     s             10i 0                            
   3500      D JlSltInf        Ds                                              
   3600      D  SiRtvDrc                     10a                              
   3700      D  SiJobId                      26a   Inz( '*INT' )              
   3800      D  SiIntJobId                   16a                              
   3900      D  SiStrKey                      4a                              
   4000      D  SiStrKeyN                    10i 0 Overlay( SiStrKey )        
   4100      D  SiMsgLenMax                  10i 0 Inz( -1 )                  
   4200      D  SiHlpLenMax                  10i 0 Inz( 0 )                    
   4300      D  SiFldIdsOfs                  10i 0 Inz( 84 )                  
   4400      D  SiFldIdsNbr                  10i 0 Inz( %Elem( SiFldIds ))    
   4500      D  SiCalMsqOfs                  10i 0 Inz( 88 )                  
   4600      D  SiCalMsqLen                  10i 0 Inz( 1 )                    
   4700      D                                4a                              
   4800      D  SiFldIds                     10i 0 Dim( 1 ) Inz( 302 )        
   4900      D  SiCalMsq                     10a   Inz( '*' )                  
   5000      D JlLstInf        Ds                                              
   5100      D  LiRcdNbrTot                  10i 0                            
   5200      D  LiRcdNbrRtn                  10i 0                            
   5300      D  LiHandle                      4a                              
   5400      D  LiRcdLen                     10i 0                            
   5500      D  LiInfSts                      1a                              
   5600      D  LiDts                        13a                              
   5700      D  LiLstSts                      1a                              
   5800      D                                1a                              
   5900      D  LiInfLen                     10i 0                            
   6000      D  LiRcd1                       10i 0                            
   6100      D                               40a                              
   6200      D JlMsgInf        Ds                                              
   6300      D  MiNxtMsgOfs                  10i 0                            
   6400      D  MiFldDtaOfs                  10i 0                            
   6500      D  MiFldNbrOfs                  10i 0                            
   6600      D  MiMsgSev                     10i 0                            
   6700      D  MiMsgId                       7a                              
   6800      D  MiMsgTyp                      2a                              
   6900      D  MiMsgKey                      4a                              
   7000      D  MiMsgF                       10a                              
   7100      D  MiMsgFlib                    10a                              
   7200      D  MiDatSnt                      7a                              
   7300      D  MiTimSnt                      6a                              
   7400      D  MiFldDta                  32767a                              
   7500      D JlFldDta        Ds                  Based( pJlFldDta )          
   7600      D  FdNxtFldOfs                  10i 0                            
   7700      D  FdFldDtaLen                  10i 0                            
   7800      D  FdFldId                      10i 0                            
   7900      D  FdDtaTyp                      1a                              
   8000      D  FdDtaSts                      1a                              
   8100      D                               14a                              
   8200      D  FdDtaLen                     10i 0                            
   8300      D  FdDta                      1024a                              
   8400       *-- Get joblog message                                          
   8500      c     *entry        plist                                        
   8600      c                   parm                    PxJobId          26  
   8700      c                   parm                    PxJobIn          16  
   8800      c                   parm                    PxMsgOpt          6  
   8900      c                   parm                    PxMsgKey          4  
   9000      c                   parm                    GetLogMs        512  
   9100      c                   parm                    pxMsgId           7  
   9200      c                   parm                    pxDatSnt          7  
   9300      c                   parm                    pxTimSnt          6  
   9400      C                   move      *blanks       GetLogMs                                                       24/02/04
   9500      C*                  Eval      SiJobId  =  PxJobId                
   9600      C                   Eval      SiIntJobId= PxJobIn                
   9700      C                   Eval      SiStrKey = x'00000000'              
   9800      C                   Select                                        
   9900      C                   When      PxMsgOpt = '*FIRST'                
  10000      C                   Eval      SiRtvDrc = '*NEXT'                  
  10100      C                   When      PxMsgOpt = '*LAST'                  
  10200      C                   Eval      SiRtvDrc = '*PRV'                  
  10300      C                   Eval      SiStrKey = x'FFFFFFFF'              
  10400      C                   When      PxMsgOpt = '*NEXT' Or              
  10500      C                             PxMsgOpt = '*PRV'                  
  10600      C                   Eval      SiRtvDrc = PxMsgOpt
  10700      C*                  If        %Parms   = 3                        
  10800      C                   Eval      SiStrKey = PxMsgKey                
  10900      C*                  EndIf                                        
  11000      C                   EndSl                                        
  11100      C                   Select                                        
  11200      C                   When      PxMsgOpt  = '*NEXT'                
  11300      C                   Eval      SiStrKeyN = SiStrKeyN + 1          
  11400      C                   When      PxMsgOpt  = '*PRV'                  
  11500      C                   Eval      SiStrKeyN = SiStrKeyN - 1          
  11600      C                   EndSl                                        
  11700      C                   Call   (e)'QGYOLJBL'                          
  11800      C                   Parm                    JlMsgInf              
  11900      C                   Parm                    JlMsgInfLen          
  12000      C                   Parm                    JlLstInf              
  12100      C                   Parm      1             JlGetRcdNbr          
  12200      C                   Parm                    JlSltInf              
  12300      C                   Parm                    JlSltInfLen          
  12400      C                   Parm                    ApiError              
  12500      C                   If        %error                              
  12600      c                   goto      fin                                
  12700      C                   EndIf                                        
  12800      C                   if        1077952576 =  MiFldDtaOfs                                                    25/02/04
  12900      c                   goto      fin                                                                          25/02/04
  13000      C                   EndIf                                                                                  25/02/04
  13100      C                   If        AeBytAvl    = *Zero And            
  13200      C                             LiRcdNbrRtn = 1                    
  13300      C                   Eval      pJlFldDta= %Addr( JlMsgInf ) +      
  13400      C                                           MiFldDtaOfs          
  13500      C*                  If        %Parms   = 3                        
  13600      C                   Eval      PxMsgKey = MiMsgKey                
  13700      C*                  EndIf                                        
  13800      C                   EndIf                                        
  13900      C                   Call   (e)'QGYCLST'                          
  14000      C                   Parm                    LiHandle              
  14100      C                   Parm                    ApiError              
  14200      C                   If        %error                              
  14300      c                   goto      fin                                
  14400      C                   EndIf                                        
  14500      C                   eval      pxMsgId =MiMsgId                    
  14600      C                   eval      pxDatSnt=MiDatSnt                  
  14700      C                   eval      pxTimSnt=MiTimSnt                  
  14800      C                   eval      GetLogMs=FdDta                      
  14900      c     fin           tag                                          
  15000      c                   seton                                        lr                                
  15100      C*                  Return    FdDta                              
  15200      P*GetLogMsg       E                                              
                                  * * * *  F I N  D E  F U E N T E  * * * *



Pedro Pinedo Hernandez
Analista-Programador
Grupo Amcor Flexibles Hispania S.L.  
Planta: Tobepal Logro�o
Departamento de Inform�tica / IT Department
tfno.:+34 941 28 60 90 - 941 03 01 39
fax: +34 941 20 75 43
26006 Logro�o
Spain
[EMAIL PROTECTED]
(quitar nospam del dominio, para enviar)


_______________________________________________________

AMCOR FLEXIBLES - LEADING THROUGH INNOVATION
_______________________________________________________

CAUTION - This message may contain privileged and confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error please notify AMCOR FLEXIBLES immediately. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of AMCOR FLEXIBLES.

Responder a