RETRY

RETRY       

This document covers the following topics:

Related Statements: ACCEPT/REJECT | AT BREAK | AT START OF DATA | AT END OF DATA | BACKOUT TRANSACTION | BEFORE BREAK PROCESSING | DELETE | END TRANSACTION | FIND | GET | GET SAME | GET TRANSACTION DATA | HISTOGRAM | LIMIT | PASSW | PERFORM BREAK PROCESSING | READ | STORE | UPDATE

Belongs to Function Group: Database Access and Update


Function

The RETRY statement is used within an ON ERROR statement block (see ON ERROR statement). It is used to reattempt to obtain a record which is in hold status for another user.

When a record to be held is already in hold status for another user, Natural issues Error Message 3145. See also the session parameter WH (Wait for Record in Hold Status).

The RETRY statement must be placed in the object that causes the Error 3145.

For details on record hold logic, see the section Record Hold Logic in the Programming Guide.

Restriction

This statement can only be used to access Adabas databases.

Example

** Example 'RTYEX1': RETRY                                              
**                                                                      
** CAUTION: Executing this example will modify the database records!    
************************************************************************
DEFINE DATA LOCAL                                                       
1 EMPLOY-VIEW VIEW OF EMPLOYEES                                         
  2 NAME                                                                
*                                                                       
1 #RETRY (A1) INIT <' '>                                                
END-DEFINE                                                              
*                                                                       
FIND EMPLOY-VIEW WITH NAME = 'ALDEN'                                    
  /*                                                                    
  DELETE                                                                
  END TRANSACTION                                                       
  /*                                                                    
  ON ERROR                                                              
    IF *ERROR-NR = 3145                                                 
      INPUT NO ERASE 10/1                                               
            'RECORD IS IN HOLD' /                                       
            'DO YOU WISH TO RETRY?' /      
            #RETRY '(Y)ES OR (N)O?'        
      IF #RETRY = 'Y'                      
        RETRY                            
      ELSE                                 
        STOP                               
      END-IF                               
    END-IF                                 
  END-ERROR                                
  /*                                       
  AT END OF DATA                           
    WRITE NOTITLE *NUMBER 'RECORDS DELETED'
  END-ENDDATA                              
END-FIND                                   
*                                          
END