Macro type: | R for PARMOD=24 |
The RETRY macro is needed in routines which are activated when a PGLOCK event occurs (EXLST exit PGLOCK). PGLOCK occurs only when an ISAM action macro is issued for a block or record which is already locked by another job. This “unsuccessful” macro can be repeated using RETRY, and the user can specify in the program whether or not RETRY is to wait for the lock to be cleared.
The RETRY macro may be called only in PGLOCK routines. If it is used elsewhere in a program, control is passed to the EXLST exit USERERR.
When the PGLOCK exit is activated, register 1 contains the FCB address; when the RETRY macro is executed, register 1 must – again – contain this FCB address.
When, after successful execution of the RETRY macro, control is returned to the caller, the contents of the registers are the same as after an action macro which was executed immediately.
If the RETRY macro is unsuccessful and control is passed to the FAIL routine, the contents of the registers are the same as before the RETRY macro was called (except for registers 0, 1, 14 and 15).
For NK-ISAM, the pointers are positioned as they were before the macro was called before the PGLOCK routine is activated (see the table "Rules for ISAM pointers").
For K-ISAM, the following should be noted: when the PGLOCK exit of the EXLST macro is activated, the internal pointers are positioned correctly only if the macro which resulted in the PGLOCK condition was a PUTX or an ELIM (without KEY). The ISAM macros GET, GETR and GETFL have already changed the pointers before they branch to PGLOCK. The RETRY macro can reset the pointers to their previous positions and can restart the macro which led to the PGLOCK condition.
If the last record which was successfully accessed before the PGLOCK exit was activated is one of a group of records with duplicate keys, resetting of the pointers to their previous positions will position the file to the first record in this group.
If ACTION=POS is specified and positioning is executed successfully, control is returned to the calling job at the instruction following the RETRY macro.
Format
Operation | Operands |
|
|
Operand descriptions
FAIL = addrexp
Address to which control is to be transferred if RETRY fails or if the waiting time for access to a block is longer than 30 minutes.
ACTION
Specifies which action is to be taken by RETRY.
= RETRY
The macro is to be retried. The operand COUNT specifies how many times the macro is to be repeated before control is passed to the FAIL address.
= WAIT
The macro is retried. If the block is still not available, the job is placed in a queue. After a wait of 30 minutes (maximum), control is passed to the FAIL routine.
= POS
For K-ISAM: the pointer is to be repositioned in the file.
NK-ISAM supports this value only for compatibility reasons.
COUNT = number
Specifies how many times the macro is to be retried before control is passed to the FAIL routine; 0 <= number <= 255.
Default value: | COUNT = 1 |
PARMOD
Specifies the generation mode for the macro.
Default value: | the value predefined for the generation mode by means of the |
= 24
The object code generated can run only in the 16-Mb address space
(24-bit addressing only).
= 31
The object code generated can run in the 2-Gb address space
(24-bit or 31-bit addressing).