Link to home
Start Free TrialLog in
Avatar of asdf13
asdf13Flag for Germany

asked on

How to ESCAPE RPG-program in error-case ?

How to ESCAPE RPG-program in error-case ?

RPG calls some API. if error happens in API-call, RPG program loops,
because of parm-length error.

How to use SDS to avoid looping (escape, without MSG, only leave RPG-pgm) ?
For example :

 I*                                                                
 I           SDS                                                  
 I                                     *PROGRAM PGNAME            
 I                                     *STATUS  PSTAT              
 I                                      254 263 USER              
                                                               
  *                                                                
0273.00      C                     MOVEL'MSGJOB'  SPC    10                  
0274.00      C                     MOVEL'TSITOOL' SPCLIB 10                  
0275.00      C                     MOVEL'*ALL '   JUSER                      
0276.00      C                     MOVEL'*ALL '   JNAME                      
0277.00      C                     MOVEL'*ALL '   JNUM                        
0278.00      C                     MOVELSPC       USRSPC                      
0279.00      C                     MOVE SPCLIB    USRSPC 20                  
0280.00      C                     Z-ADD2         ANZK                        
0281.00      C                     Z-ADD0101      K1                          
0282.00      C                     Z-ADD1906      K2                          
0283.00       *                                                              
0284.00       *  USERSPACE                                
0285.00      C                     CALL 'QUSCRTUS'             33            
0286.00      C                     PARM           USRSPC                      
0287.00      C                     PARM           EXT    10                  
0288.00      C                     PARM 10000     ISIZE          
0289.00      C                     PARM           IVAL    1          
0290.00      C                     PARM '*ALL'    AUT    10          
0291.00      C                     PARM 'PTF '    TEXT   50          
0292.00      C                     PARM '*YES '   REPL   10          
0293.00      C                     PARM           ERR    30            

In Joblog :
  CPD3C0F    Message . . . . :   Value 359658433 for starting position parameter is not  
    valid.                                                                    
  Cause . . . . . :   Value 359658433 for starting position value for this    
    operation is not valid. Recovery  . . . :   Specify a valid value greater

  CPD3C12   Message . . . . :   Length of data is not valid.                            
  Cause . . . . . :   The value 1077952576 you specified for the length of dat
    parameter is not valid. Recovery  . . . :   Specify a valid value greater
    than zero and less than the maximum allowable size for a user space for th
    length of data and try the request again.                                
                 
  CPF3C06    Escape   Message . . . . :   Information not retrieved from user space MSGJOB.      
  Cause . . . . . :   Information was not retrieved from user space MSGJOB in
    library TSITOOL. Recovery  . . . :   Display the job log to determine why
    information could not be retrieved from the user space (DSPJOBLOG command)
    Correct the errors and try the request again.                  
 
       
  CPF9999   Message . . . . :   Function check. CPF3C06 unmonitored by GETJOB at stateme
    32700, instruction X'0082'.                                              
  Cause . . . . . :   An escape exception message was sent to a program which
    did not monitor for that message. Loop about  CPD3C0F  CPD3C12  CPF3C06  CPF9999
                                                     
 Looping within:     CPD3C0F    CPD3C12  CPF3C06  CPF9999 . . . . .

how to prevent looping ?
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of asdf13

ASKER

I will test - thanks a lot for your advice.