Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example 3: Preventing conflicts

&pagelevel(4)&pagelevel

You want to move as much as possible toward the beginning of the realm. However, at some time the database will be detached. The UDS online utility will then be terminated immediately. The realm has 10,000 pages. In the event of information about conflicts (here: more than 5) the UDS online utility should also terminate. Normally three pages are emptied in a transaction.

//SET-ONLINE-UTILITY-PARAMETERS -
// DBH=*INDEPENDENT, -
// CONFIGURATION-NAME=SESSION3
//SET-RELOCATE-PARAMETERS -
// SUBSCHEMA-NAME=SUB3, -
// REALM-NAME=AREA3, -
// PAGES-PER-DML=3
//DECLARE-VARIABLE -
// VARIABLE-NAME=NRCLASHS, -
// TYPE=*INTEGER, -
// INITIAL-VALUE=0
//DECLARE-PROCEDURE -
// PROCEDURE-NAME=TA3, -
// CODE=*SYSDTA
/SEND-DATA -
/ RECORD=’READY UPDATE;RELOCATE;’
/SEND-DATA -
/ RECORD=’EXIT COND=STATUSCODE EQ 010’
/SEND-DATA -
/ RECORD=’ADD NRCLASHS,1,COND=RELOC-FREED-PAGES LT 3;FINISH’
/SEND-DATA -
/ RECORD=’EXIT COND=NRCLASHS GE 5’
/SEND-DATA RECORD=*EOF
//REPEAT-PROCEDURE -
// PROCEDURE-NAME=TA3, -
// CYCLE-LIMIT=10000
//SHOW-VARIABLE RELOC-ORIGIN
//SHOW-VARIABLE RELOC-DESTINATION

Alternatively, you can also enter the DMLs of the procedure TA3 directly via SYSDTA.
It is essential here that the procedure input is terminated with END.

//...
//DECLARE-PROCEDURE -
// PROCEDURE-NAME=TA3, -
// CODE=*SYSDTA
READY UPDATE;RELOCATE;
EXIT COND=STATUSCODE EQ 010
ADD NRCLASHS,1,COND=RELOC-FREED-PAGES LT 3;FINISH
EXIT COND=NRCLASHS GE 5;END
//REPEAT-PROCEDURE -
// PROCEDURE-NAME=TA3, -
// CYCLE-LIMIT=10000
//...